Hello,
We've recently migrated Jira (v8.20.12) to kubernetes and we're looking for a way to send the logs to stdout and avoid the sidecar.
Is there a way to do that? For example, we just want to focus on the atlassian-jira.log file.
Here's what we've tried.
We've modified the log4j.properties, but whenever we modify it, the formatting goes wrong. Also, it doesn't seem to be registering the desired logs.
Changes we've done/tested:
1.- Include 'console' previously under log4j.rootLogger
2.- Include 'stdout' under log4j.rootLogger and the appender as well with the following lines:
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=com.atlassian.logging.log4j.NewLineIndentingFilteringPatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSSZ} %t %p %X{jira.username} %X{jira.request.id} %X{jira.request.assession.id} %X{jira.request.ipa
ddr} %X{jira.request.url} [%q{2}] %m%n
----
We also tested the sidecar without ES as we already have a fluentbit statefulset picking up all stdout from all containers.
Also, there's a line that says:
# The appender (fluentdAppender) is disabled by default, but can be enabled via the 'atlassian.logging.cloud.enabled' system property.
Now, I didn't know where to do that, so I just went to the Jira UI and updated the HTTP Access Logging, but everytime the container restarts, as normal, it disables it as default.
We also included the packages for fluentdAppender and stdout, just in case.
TL;DR, how can I send the logs from atlassian-jira.log saving to a local file to stdout?
Thank you!
HI @veruskap
the Console appender should already be directed to STDOUT.
Is the issue that when using the jira startup script it's started as a separate process so you don't see logging in the terminal window?
try running in the foreground. From the bin directory start using
./start-jira.sh -fg
Would seeing the logging in the window be different from using
tail -f atlassian-jira.log
in the /jira-home/log directory.
If you change logging in the Logging & Profiling page, any changes will be lost on startup. You would need to put changes into WEB-INF/classes/log4j.properties to make them permanent.
As an example, when using scriptrunner, I set up a logging category to capture only logged comments from scripts as a separate file so I can easily read the trace output.
Hi Tom,
Sorry for the very late reply, but this was on hold.
As I mentioned Jira is running in Kubernetes and we just wanted to forward the logs elsewhere , to a third party. And like they have in their helmchart, the solution is a sidecar for that.
So that's what we did in the end, although with a different image.
Thanks for your quick reply at the moment and comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.