Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log details of creaper commands #151

Closed
mchoma opened this issue Feb 1, 2017 · 5 comments
Closed

Log details of creaper commands #151

mchoma opened this issue Feb 1, 2017 · 5 comments
Milestone

Comments

@mchoma
Copy link
Collaborator

mchoma commented Feb 1, 2017

Here is the idea. Enable TRACE logging of commands, by extending OperationsModelNodeBuilder with logging of op.toJSONString(false).
{ "operation" : "add", "address" : [ { "subsystem" : "elytron" }, { "key-store" : "CreaperTestKeyStore" } ], "name" : "CreaperTestKeyStore", "type" : "JKS", "credential-reference" : {"clear-text" : "password"} }

Sometimes it come useful to see exactly what is going on in server configuration. Also this output could be used to build reproducers. Copy output from log and pass it to
curl --digest -L -D - http://localhost:9990/management -u admin:asdasd --header "Content-Type: application/json" -d '{"operation":"reload","name":"", "address":{"host" : "master"},"json.pretty":1}'
Now I only get:
INFO: Applying command org.wildfly.extras.creaper.commands.elytron.tls.AddKeyStore@7d3d101b

@Ladicek , WDYT?

@simkam
Copy link
Collaborator

simkam commented Feb 1, 2017

+100 it would be very useful

@rhatlapa
Copy link

rhatlapa commented Feb 1, 2017

+1 from me for the trace logging.

Regarding what you are getting now on INFO level depends on you writing toString() method on commands. Which is highly recommended to do.

@Ladicek
Copy link
Contributor

Ladicek commented Feb 2, 2017

I was actually considering lowering the logging of commands from INFO to DEBUG, because it's just noise.

Also, all mgmt operations are already logged on DEBUG, see OnlineManagementClientImpl.execute. I agree that the format probably isn't ideal and I'm fine with changing it. Or possibly adding a second logging on TRACE that would be more machine-readable. In any case, OperationsModelNodeBuilder would be a wrong place.

@mchoma
Copy link
Collaborator Author

mchoma commented Feb 2, 2017

How reliable is ModelNodeOperationToCliString.convert(Modelnode operation) ? In fact, personally I prefer CLI Strings :) But I am afraid converting from ModelNode into Cli String will have some pitfalls.

@Ladicek
Copy link
Contributor

Ladicek commented Feb 2, 2017

It is not reliable :-), though it should work just fine in the simple cases (no arrays, no objects, no "bytes"). I'm open to changing it however you wish.

mchoma added a commit to mchoma/creaper that referenced this issue Feb 8, 2017
mchoma added a commit to mchoma/creaper that referenced this issue Feb 8, 2017
mchoma added a commit to mchoma/creaper that referenced this issue Feb 8, 2017
mchoma added a commit to mchoma/creaper that referenced this issue Feb 9, 2017
mchoma added a commit to mchoma/creaper that referenced this issue Feb 9, 2017
mchoma added a commit to mchoma/creaper that referenced this issue Feb 9, 2017
mchoma added a commit to mchoma/creaper that referenced this issue Feb 13, 2017
mchoma added a commit to mchoma/creaper that referenced this issue Feb 13, 2017
Ladicek pushed a commit that referenced this issue Feb 13, 2017
@Ladicek Ladicek added this to the 1.6.0 milestone Apr 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants