How to configure wso2 servers logging the same level of detail as console output in wso2carbon.log file

StackOverflow https://stackoverflow.com/questions/18313886

  •  25-06-2022
  •  | 
  •  

Question

When we run the bin/wso2server.sh file in a terminal, we get nice verbose logging output in the same terminal which is very useful for debugging. But the output in the repository/log/wso2carbon.log file is minimal. I have checked all the other files in the repository/log/ directory and none have the same level of verbosity as the console output.

I tried settings under Home > Configure > Logging after logging in to the management console of wso2 application server. Specifically I set the settings for "Configure Log4J Appenders" for CARBON_LOGFILE to be the same as for CARBON_CONSOLE but this did not have desired effect. The web application level info and debug messages are shown on the terminal from where we started the wso2 application server but this is not shown in the wso2carbon.log file.

How do we get the same level of detail i.e. verbose output like we get in the terminal into the repository/log/wso2carbon.log file?

Était-ce utile?

La solution

I tried a lot of changes via the "Home > Configure > Logging" of the WSO2 web based management console, to get the same level of detail as the console into the logfile but none had the desired effect. In fact I observed that even though I changed the Log Pattern of CARBON_LOGFILE to [%d] %5p - %x %m {%c}%n I still kept getting logs in the TID: [0] [AS] [2013-08-23 15:11:10,025] format in the repository/logs/wso2carbon.log file. There is definitely some problem with setting log file detail level and pattern via the web based management console at least on version wso2as 5.0.1

So I ended up hacking the bin/wso2server.sh file.

I changed the line

nohup bash $CARBON_HOME/bin/wso2server.sh > /dev/null 2>&1 &

under both start and restart sections to

nohup bash $CARBON_HOME/bin/wso2server.sh > $CARBON_HOME/repository/logs/wso2carbon.log 2>&1 &

Now I am getting same logs as console in the file.

I know its a hack but atleast I am able to get the detailed debug logs in a file for offline analysis.

Hope someone from wso2 looks into the issue of log level & pattern setting via the web based management console and solves it..

Autres conseils

By default the console output and the wso2carbon.log file should be the same. I checked and both have the same output. In "Configure Log4J Appenders" see whether you have DEBUG as the Threshold for both CARBON_LOGFILE and CARBON_CONSOLE.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top