tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From java developer <replyj...@gmail.com>
Subject Re: Configure Tomcat Logging Programmatically
Date Tue, 10 Dec 2013 12:03:47 GMT
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 silent    <code>true</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.
     *                  <code>false</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-hill@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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message