0

I'm currently in the middle of changing my application logging type from standard output to file.

I approached a problem with configuring Team City to automatically append my log file to build log, so I can see tests results and stack traces in case of fail.

I have tried googling it, but I have only find one suggestion to manually cat contains of log file to build log.

HappyAXE
  • 116
  • 7

1 Answers1

0

Usually logging system lets you define handlers or outputs, where your data should go. Basically, you can tell it to output to stdout, file, remote log server etc. So first I would suggest reading documentation of your logging system (by the way, what language and what logging system do you use?).

Alternatively, you can use tee command:

Tee command is used to store and view (both at the same time) the output of any other command. Tee command writes to the STDOUT, and to a file at a time.

grundic
  • 4,641
  • 3
  • 31
  • 47
  • It's java. I actually want to STOP writing to console, because of large amount of console output slowing down application. – HappyAXE Jun 20 '17 at 11:21
  • In this case I would recommend playing with log levels: let INFO and higher go to console and all debug messages go to the file. In this case you would see all logs in realtime in Teamcity and in case of problems you would be able to download full file log. – grundic Jun 20 '17 at 11:29
  • I have similiar problem, I am using log4j. Any suggestions? – Michał Rowicki Jun 20 '17 at 12:13
  • There a lot of examples of configuration of log4j. Try [this](https://stackoverflow.com/a/14636765/279355) one. – grundic Jun 20 '17 at 18:54