Limit logging
Hi,
I'm still trying to figure out how I can limit the log level of youtrack if it runs inside of a standalone Jetty 6 Servlet container on an default ubuntu server 10.04 installation.
The method described in the youtrack documentation seems to only apply to some "log files" that aren't even present on my installation. What jetty does is that it takes all stdout and stderr output and writes this to its own log file. For some reason youtrack outputs enourmus amounts of logging on the "INFO" level via stdout and I'm not able to change this.
Logs like this are logged multiple times every second:
221040 [http request: /_events?window_id=2 [l.I.sb.s.countIssuesTicker:tick]] INFO jetbrains.mps.webr.runtime.servlet.MainServlet - Finish processing request /_events?window_id=2 [l.I.sb.s.countIssuesTicker:tick] in 1ms
I do not need this logs and all it does is that it kills cpu and disk performance...
I'm still trying to figure out how I can limit the log level of youtrack if it runs inside of a standalone Jetty 6 Servlet container on an default ubuntu server 10.04 installation.
The method described in the youtrack documentation seems to only apply to some "log files" that aren't even present on my installation. What jetty does is that it takes all stdout and stderr output and writes this to its own log file. For some reason youtrack outputs enourmus amounts of logging on the "INFO" level via stdout and I'm not able to change this.
Logs like this are logged multiple times every second:
221040 [http request: /_events?window_id=2 [l.I.sb.s.countIssuesTicker:tick]] INFO jetbrains.mps.webr.runtime.servlet.MainServlet - Finish processing request /_events?window_id=2 [l.I.sb.s.countIssuesTicker:tick] in 1ms
I do not need this logs and all it does is that it kills cpu and disk performance...
Please sign in to leave a comment.
This discussion mentions logging configuration file. Please mind that as of YouTrack 2018.1 the correct location is WEB-INF/lib/youtrack-webapp-xxxx.jar!/log4j.xml
Looks like we've already talked about it here:
http://youtrack.jetbrains.com/issue/JT-12092
Have you tried this way?
http://confluence.jetbrains.net/display/YTD4/Configuring+Logging+in+YouTrack
Could you please explain to me where these log files normally should turn up? You are configuring FileAppenders in Log4J so there must be files created somewhere, am I right? I don't have these files. Additionally YouTRACK seems to log on level INFO to it's standard output stream (stdout) regardles of any configuration. Jetty takes all stdout and stderr output and writes it to its own log file. This file is growing fast without any decent reason...
I deployed YouTRACK as a .WAR in a default Jetty on Ubuntu 10.04. i.e. I'm not using the .JAR distribution with it's embedded jetty.
To disable the described output please do following steps:
Go to Jetty webapps directory (default path is /usr/share/jetty/webapps).
Find YouTrack's WAR file and unpack it (you can use Midnight Commander if you want).
Edit file WEB-INF/classes/jetbrains/charisma/main/log4j.xml
To disable stdout logging find appender ASYNC and comment string <appender-ref ref="CONSOLE"></appender-ref>
So, ASYNC appender's section should be like this:
To disable messages from jetbrains.mps.webr.runtime.servlet.MainServlet you need to add new category section:
Then save file and pack all early unpacked data back to WAR file.
Restart Jetty server.
P.S. You can find YouTrack log files in /var/log/jetty (this is default path).
Could you please show me your log4j.xml. I'd like to see the file from Jetty's cache.
You can find it at path like this /var/cache/jetty/data/Jetty__8080_youtrack.war__youtrack__.gc13wk/webapp/WEB-INF/classes/jetbrains/charisma/main/log4j.xml
sorry for the long wait. Here is the log4j.xml right from the Jetty cache:
http://pastebin.com/Yqzk4h04
Your configuration file log4j.xml is correct.
I've just placed it in my war file and restarted application.
So, I don't see described messages neither in out.log nor in youtrack.log.
Maybe you see old messages?
BTW after these manipulations with log4j.xml you can still see messages like these in jetty's request.log:
127.0.0.1 - - [22/Oct/2012:10:52:38 +0000] "POST /_events?window_id=12 HTTP/1.1" 404 1372
127.0.0.1 - - [22/Oct/2012:10:53:00 +0000] "POST /youtrack/_events?window_id=8 HTTP/1.1" 200 83
But to disable it you need to configure Jetty.
Or I'm not right and you continue see these messages in out.log and youtrack.log?
We host all our applications via Jetty around here and I've always been under the impression that stderrout*.log holds the stdout and stderr of all deployed web applications. I do not know why it seems to be a lot trickier with YouTRACK.
Could you please stop Jetty, clean cache directory and start Jetty again?
I'm using version 6.1.24-6ubuntu0.11.10.1 with default configs on Ubuntu 11.10.
If you have any custom changes in your configs then please provide me them.
And it would be great to get your version of war file. You can upload archive to ftp://ftp.intellij.net/.uploads/ (it's accessible for write only).
I've set up environment as you have Ubuntu 10.04 / Jetty=6.1.22-1ubuntu1.1 / YouTrack (your youtrack.war)
And I cannot reproduce the problem.
After running YouTrack I have following content in stderrout.log:
$ cat /var/log/jetty/2012_10_23.stderrout.log
2012-10-23 18:45:31.330:INFO::jetty-6.1.22
2012-10-23 18:45:31.362:INFO::Deploy /etc/jetty/contexts/javadoc.xml -> org.mortbay.jetty.handler.ContextHandler@17bd6a1{/javadoc,file:/usr/share/doc/libjetty-java/api/}
2012-10-23 18:45:31.399:INFO::Extract file:/var/lib/jetty/webapps/youtrack.war to /var/cache/jetty/data/Jetty_0_0_0_0_8080_youtrack.war__youtrack__50vvgb/webapp
2012-10-23 18:45:33.332:INFO::NO JSP Support for /youtrack, did not find org.apache.jasper.servlet.JspServlet
2012-10-23 18:45:35.093:INFO::NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
2012-10-23 18:45:35.102:INFO::Opened /var/log/jetty/2012_10_23.request.log
2012-10-23 18:45:35.111:INFO::Started SelectChannelConnector@0.0.0.0:8080
Init web application log4j location: jetbrains/charisma/main/log4j.xml
That's all.
So, it seems the problem in your configuration.
P.S. Maybe there is other YouTrack instance deployed on your server?
thanks for your investigation. This is pretty strange then. The only difference between our two setups is that I additionally host the .war distribution of sonatype nexus in this jetty. Can two separate webapps influence their logging configuration? But then I remember that the issue with too much logging although appeared back when our admin hosted youtrack on a separate machine in its own dedicated Jetty.