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
JSON logging in payara micro #1672
Comments
+1 |
Hi @larslorenzen - In your Version 3, have you only used your own formatter, or did you try with Before I look into this in any great detail, my thought is that using an asadmin command would not work with a A There are a couple of ways to "persist" the changes from a |
Ah yes sorry, was a copy&paste mistake from me, it did not work with the payara logging formatter either. |
Payara Micro logging is different from Payara Server. Payara Micro logging is purely driven by the logging.properties file so 1 and 2 will not work. Not sure why 3 doesn't |
The full payara has the same behaviour when run in verbose mode
We are running payara micro inside a docker container on kubernetes. For this i needed to bundle the hazelcast-kubernetes-plugin inside the payara micro jar. After bundling it with the shade plugin, the |
There are 2 problems:
Quick solution
Dockerfile
|
You could also package this custom JSON Logger and bundle up hazelcast-kubernetes-plugin into an uber jar using the new Payara Micro Maven plugin. I'll take a look to see why JSON Logger doesn't work. |
Yes i saw that one also already and wanted to try it out but could not find the plugin artifacts in the maven central repo. At the moment we package the hazelcast-kubernetes-plugin into the micro payara jar with the maven shade plugin.
and run that resulting jar then with --deploy ROOT.war The assembly:
And the payara-drivers:
I tried adding a custom json logger the same way but could not get it to work. Maybe providing the logger.jar in the java -cp might do the trick. |
I thought we'd pushed the plugin to maven central Doh! I'll get onto it. |
Hi @smillidge, any status update on this? would be great to have json logging in place for micro..... |
FYI: the Maven plugin is now available in Maven Central <dependency>
<groupId>fish.payara.maven.plugins</groupId>
<artifactId>payara-micro-maven-plugin</artifactId>
<version>1.0.0</version>
</dependency> |
Another attempt: https://github.com/loraneo/json-log-formatter
Little bit cleaned code. |
(Rookie here.) Just wanted to add another data point in case it helps. There's also my related StackOverflow question which I suspect is related to this issue. Running Payara Micro with a
…also does not work in version 172: the output seems to be the same, in fact, no matter what formatter class is specified. I've tried:
All result in output that looks like this:
I know that my Perhaps this is the culprit: Lines 1540 to 1542 in a6a5ea8
Anyway, hope this helps with the investigation. Thanks for a great product. |
This will be fixed in #1835 |
The issue described in my comment above is still present in Payara Micro 174. From debugging into the That is, as before, my You can see this if you set a breakpoint in Note that this comment correctly diagnoses the issue, which is that the Finally, in case it helps, the following formatter classes are also not loadable by the System classloader:
I am using Java 8 if it matters. |
(Ah, looking deeper, it appears that perhaps this set of changes, where you explicitly work around the system classloader requirement, is in effect only if someone does not supply a |
I can confirm that the formatting does not work at all with micro payara 174 if you suppy a |
Can we please have an update on this issue? I'm experiencing the same on payara micro 174, and would like to use this in production. |
Perhaps it should be reopened? It is obviously not fixed by #1835. |
Cant get it to work either, this needs to be reopened. |
I have payara micro v5 and after a lot of trial and errors, this worked for me: |
Description
Hi, i tried to activate JSON logging in payara micro but could not get it to work.
Expected Outcome
Current Outcome
In version 1: prebootcommand there is no change in the log format
In version 2: postbootcommand there is no change in the log format
In version 3: A slight change in the log format but still no JSON
Steps to reproduce (Only for bug reports)
Version 1
Version 2
Version 3: That's the only time there is a change in the log output format but still no JSON.
The full payara seems to have the same problem when started in verbose mode
./asadmin start-domain -v domain1
Environment
The text was updated successfully, but these errors were encountered: