Configuring Teamcity's logging behaviour

末鹿安然 提交于 2020-01-05 04:48:30

问题


I'm using Teamcity 5 for our CI environment. It's a great tool, but I've been struggling with one thing: the stdout_yyyyMMdd.log file in the \TeamCity\logs folder grows to ridiculous sizes. Is there a way to turn it off?

Places I've looked so far:

  • Jetbrains: Nothing on stdout;
  • Google for "tomcat stdout logs": the first few links don't really address the issue.

Edit:

At KIR's suggestion, I actually looked to see what's in stdout. It's the same exception message repeated over and over again:

[2010-12-01 08:57:21,268]   WARN -   jetbrains.buildServer.SERVER - java.io.FileNotFoundException: <...Path...>\.BuildServer\system\caches\search\_8p.prx (The system cannot find the file specified) 
[2010-12-01 08:57:21,315]  ERROR - erverSide.search.SearchService - SearchService.enqueueHistory 
java.io.FileNotFoundException: <...Path...>\.BuildServer\system\caches\search\_8p.prx (The system cannot find the file specified)
    at java.io.RandomAccessFile.open(Native Method)
    at java.io.RandomAccessFile.<init>(Unknown Source)
    at org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput$Descriptor.<init>(SimpleFSDirectory.java:78)
    at org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput.<init>(SimpleFSDirectory.java:108)
    at org.apache.lucene.store.SimpleFSDirectory.openInput(SimpleFSDirectory.java:65)
    at org.apache.lucene.index.SegmentReader$CoreReaders.<init>(SegmentReader.java:132)
    at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:638)
    at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:599)
    at org.apache.lucene.index.DirectoryReader.<init>(DirectoryReader.java:104)
    at org.apache.lucene.index.ReadOnlyDirectoryReader.<init>(ReadOnlyDirectoryReader.java:27)
    at org.apache.lucene.index.DirectoryReader$1.doBody(DirectoryReader.java:74)
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:704)
    at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:69)
    at org.apache.lucene.index.IndexReader.open(IndexReader.java:476)
    at org.apache.lucene.index.IndexReader.open(IndexReader.java:314)
    at jetbrains.buildServer.serverSide.search.SearchService.getIndexSearcher(SearchService.java:451)
    at jetbrains.buildServer.serverSide.search.SearchService.enqueueHistory(SearchService.java:515)
    at jetbrains.buildServer.serverSide.search.BackgroundIndexer.run(BackgroundIndexer.java:32)
    at java.lang.Thread.run(Unknown Source)

Any idea what this file is?


回答1:


If you're running TC on unix you could use logrotate: http://linuxcommand.org/man_pages/logrotate8.html (Obviously, this is a workaround but it should be effective.)

This guy has a windows equivalent that may do the trick too: http://www.datori.org/?p=7




回答2:


Remove .BuildServer\system\caches\search directory and restart TeamCity. May be this would help.




回答3:


The problem is caused by someone or something deleting the Lucene Index in Team city. Everytime you hit a page after this it will log in stdout that it couldnt find the file.

If you clear out the whole folder which should be %USERPROFILE%.BuildServer\system\caches\search\

See http://confluence.jetbrains.net/display/TCD5/TeamCity+Data+Directory for more information on where to find the folder.

And restart Teamcity it will recreate the index on start up and stop logging the error message.

Oh and search should start working again too.



来源:https://stackoverflow.com/questions/4931352/configuring-teamcitys-logging-behaviour

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!