-
Notifications
You must be signed in to change notification settings - Fork 16
Added support for logging in JSON format to a file. #20
Added support for logging in JSON format to a file. #20
Conversation
Signed-off-by: Nick Wemekamp <[email protected]>
ddd4fc5
to
f626774
Compare
@NickWemekamp While we get some reviewers on this, I need you to follow the process outlined in https://github.com/oracle/weblogic-monitoring-exporter/blob/master/CONTRIBUTING.md. In short, you need sign the contributors agreement and "sign" your a commit that is part of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to sign OCA and commit.
fh.setFormatter(new EcsFormatter()); | ||
logger.addHandler(fh); | ||
} else { | ||
System.out.println("WebLogic Elasticsearch Logging Exporter is disabled"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@russgold, @marinakog, I'm not as familiar with the logging exporter code base. I'm guessing that we are using System.out.println for logging from the exporter because the Java logging system is being used for messages bridged from WebLogic, correct? Is it possible to structure this so that we can still use logging for the exporter's messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with this code base at all, actually. And Huiling is the one who was testing this exporter, not Marina.
Hi @NickWemekamp, I am reviewing and testing, will be in touch soon. Thanks for your PR! |
I got this built and tested it. I noticed that the output has a subset of fields (see below). I'd like to make it include all the fields by default and/or make it configurable.
There's a few little nitpicks, like I'd probably like to think a bit more about the config file format too. This seems to basically "switch" between two diff formats. I think I'd like to look at something more structured, like a yaml file or something. But that'd be a breaking change, and so i'd probably make that change in a v2.0. I might also like to think about making the build produce an uberjar so it is easier to install. Are you interested in contributing to such changes? If not, are you ok for me to grab what you have here and take it a little further? |
Hi @markxnelson thanks for your review. I still need permission for the contributors agreement but I'll prioritise that tommorow. The switch between the two diff formats and having to explicitly disable the elasticsearch output is indeed a bit awkward, I wanted my contribution to be a non breaking change as much as possible that is why I did it this way. Feel free to change it. The fat jar and additional fields are useful as well. I think it is more practical if you take the code and edit it further as you have a better idea about what the log format should look like. If you want to include additional fields like 'diagnosticContextId' I think having a custom formatter that looks similar to ECSFormatter is a good way to go. It is very helpful for us if the |
hi @NickWemekamp sounds good - it'd be great if you are able to sign the OCA, i could pull what you have contributed into a branch and add a few bits and pieces, so you'll get the credit :) |
I signed the OCA |
…required dependencies. Signed-off-by: Nick Wemekamp <[email protected]>
@markxnelson I've added the missing WebLogic fields and a fat jar maven build. We're planning on using the JSON formatter so if you can make a new release (with or without the config file changes) that would be great. |
Thanks @NickWemekamp - I am planning to do a release for you early next week (holidays here) something like a 2.0-alpha-1 or something, with your stuff in it, and then when I get the other work done, we'll move towards a 2.0. |
Hi @NickWemekamp - I did a release for you -> https://github.com/oracle/weblogic-logging-exporter/releases/tag/2.0-alpha-1 |
ok - i did what i need to do, i am going to respin that same release with the uberjar in it too |
This merge request add supports for writing JSON logs from a WebLogic server to a file directly on the server.
It uses the EcsFormatter from Elastic.