CodeCompass icon indicating copy to clipboard operation
CodeCompass copied to clipboard

Write log messages to file

Open intjftw opened this issue 4 years ago • 2 comments

Log messages are currently written solely to the console. This is the case in both the parser and the web service. CC should also be able to direct log messages to log files, based on the source and the severity level. The log files should be stored in the workspace directory.

intjftw avatar Mar 02 '21 13:03 intjftw

I run CodeCompass_webserver application as daemons through supervisor, and then supervisor can save the CC stderr and stdout as log file in my workspace: https://github.com/shijunjing/edk2/wiki/CodeCompass-enabling#run-codecompass_webserver-application-as-daemons

stderr_logfile=/home/jshi19/CodeCompass/workspace/test_stderr.log
stdout_logfile=/home/jshi19/CodeCompass/workspace/test_stdout.log

shijunjing avatar Mar 03 '21 01:03 shijunjing

Thanks for sharing how you solve this issue @shijunjing , it is a nice workaround.

However, it would be better in the long run to automatically create a log file, so it is always available, even if redirecting the console output was not configured. In internal use cases it occurred that it would aid our work if can ask for such log files e.g. for debugging a reported issue. Since we are using the logger in the Boost Library, it shouldn't be hard to define a new log target (sink), so all log messages will be saved to file, too. That way we can even have a different log level for the console output and the log file.

mcserep avatar Mar 03 '21 08:03 mcserep