-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat(log): allow to pass in custom loggers #69
base: main
Are you sure you want to change the base?
Conversation
f82f8c7
to
013c5a9
Compare
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.
Code looks good, and function is useful. I'm kind of missing an assertion in the testsuite that actually ensures that the custom logger is used, and the default logger is not.
@duncdrum Do you have an idea how to test this properly? |
Not sure i understand your question, create a test log entry, and make sure that it only appears in the |
@duncdrum That's what I was looking for :) How does one access the logs of the docker container within GitHub-actions? |
|
What is the default log-level within exist-db stock images? |
WARN i think, its in the config file in the core repo |
It's safe to assume |
https://github.com/eXist-db/exist/blob/develop/exist-docker/src/main/xslt/log4j2-docker.xslt any of these will do, just copy the log4j file into the image |
I think for now it would make sense to just test that certain messages are logged to exist.log and others are not. |
We can but testing the presence of certain messages in |
Yes, testing that log output is written to |
Aha, in the docker log configuration all messages with level INFO are directed to stdout |
From my manual testing I could see that the message format is predictably different, though. |
show me the message format preferably in code, and i ll tell you |
I'll give you an example: When passing $logger("info", "[f6ad7ba0-8722-431f-ad7b-a08722e31f59] request get /jwt/public/1/2/this/is/just/a/test") This yields following output to stdout
Each line will always start with
|
Looks like good testcase. Although users might actually more care about actual log files on disc. As long as there are some tests I m happy. Whichever you are more comfortable with. |
The whole logging facility has 0 coverage at the moment. Testing docker stdout will bring us a big leap forward. |
Add new function signature roaster:route#4 allowing to pass in a custom log function.
This allows for control what is logged where and how.
Log to stdout and stderr
Log using
util:log-app
For the above to work the logger needs to be added to log4j2.xml