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

JSON logging #21

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

JSON logging #21

wants to merge 5 commits into from

Conversation

bsanchezb
Copy link
Collaborator

@bsanchezb bsanchezb commented Feb 1, 2024

Hi,

I did some changes in order to store logs in a file a JSON format. This will produce logs looking like:

...
{"@timestamp":"2024-02-01T10:15:35.8574965Z","@version":"1","message":"+ New CommonCertificateVerifier created.","logger_name":"eu.europa.esig.dss.validation.CommonCertificateVerifier","thread_name":"pool-1-thread-6","level":"INFO","level_value":20000,"dd.trace_id":"5951534357321232569","dd.service":"org.apache.catalina.startup.Bootstrap","dd.span_id":"3966466547867123206"}
{"@timestamp":"2024-02-01T10:15:35.9732396Z","@version":"1","message":"+XAdESCertificateSource","logger_name":"eu.europa.esig.dss.xades.validation.XAdESCertificateSource","thread_name":"pool-1-thread-17","level":"INFO","level_value":20000,"dd.trace_id":"5951534357321232569","dd.service":"org.apache.catalina.startup.Bootstrap","dd.span_id":"3966466547867123206"}
{"@timestamp":"2024-02-01T10:15:36.0360798Z","@version":"1","message":"+ New CommonCertificateVerifier created.","logger_name":"eu.europa.esig.dss.validation.CommonCertificateVerifier","thread_name":"pool-1-thread-17","level":"INFO","level_value":20000,"dd.trace_id":"5951534357321232569","dd.service":"org.apache.catalina.startup.Bootstrap","dd.span_id":"3966466547867123206"}
{"@timestamp":"2024-02-01T10:15:40.3330794Z","@version":"1","message":"Analysis is DONE for 31 TLSource(s)","logger_name":"eu.europa.esig.dss.tsl.job.TLValidationJob","thread_name":"pool-2-thread-1","level":"INFO","level_value":20000,"dd.trace_id":"5951534357321232569","dd.service":"org.apache.catalina.startup.Bootstrap","dd.span_id":"3966466547867123206"}
{"@timestamp":"2024-02-01T10:15:40.9786853Z","@version":"1","message":"Online refresh is DONE.","logger_name":"eu.europa.esig.dss.tsl.job.TLValidationJob","thread_name":"pool-2-thread-1","level":"INFO","level_value":20000,"dd.trace_id":"5951534357321232569","dd.service":"org.apache.catalina.startup.Bootstrap","dd.span_id":"3966466547867123206"}
...

You should be able to find the log file under "logs/dss.log" name within tomcat folder in your Docker environment.

After you need to configure Datadog as explained at https://docs.datadoghq.com/logs/log_collection/java/?tab=logback#json-format

Best regards,
Aleksandr

P.S. Additionally, I had to revert the change within "setenv.sh" file, as it caused issues in my build. I am not sure why the change was made, but if you find it better, feel free to change it back.


@AndesKrrrrrrrrrrr
Copy link
Member

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

Successfully merging this pull request may close these issues.

2 participants