Re: Configure Tomcat Logging Programmatically

2013-12-10 Thread java developer
Hi,
Calling tomcat.setSilent(false) might help. Just try this and see if this
helps. Below is small funcation from Tomcat class.


/**
 * Controls if the loggers will be silenced or not.
 * @param silentcodetrue/code sets the log level to WARN for the
 *  loggers that log information on Tomcat start up.
This
 *  prevents the usual startup information being logged.
 *  codefalse/code sets the log level to the default
 *  level of INFO.
 */
public void setSilent(boolean silent) {
for (String s : silences) {
if (silent) {
Logger.getLogger(s).setLevel(Level.WARNING);
} else {
Logger.getLogger(s).setLevel(Level.INFO);
}
}
}



On Mon, Dec 9, 2013 at 11:16 AM, Matthew Westwood-Hill 
matthew.westwood-h...@nuix.com wrote:

 I am running Tomcat programmatically (embedded) and I wanted to configure
 its logging so I can track inbound request.



 I start Tomcat as follows:



 tomcat = new Tomcat();

 tomcat.setBaseDir(DEFAULT_BASE_DIR);

 tomcat.getService().addConnector(defaultConnector);

 tomcat.setConnector(defaultConnector);

 tomcat.init();

 tomcat.start();



 How do I go about configuring the logging?



 Cheers,

 Matt



Configure Tomcat Logging Programmatically

2013-12-09 Thread Matthew Westwood-Hill
I am running Tomcat programmatically (embedded) and I wanted to configure
its logging so I can track inbound request.



I start Tomcat as follows:



tomcat = new Tomcat();

tomcat.setBaseDir(DEFAULT_BASE_DIR);

tomcat.getService().addConnector(defaultConnector);

tomcat.setConnector(defaultConnector);

tomcat.init();

tomcat.start();



How do I go about configuring the logging?



Cheers,

Matt