You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Baron Fujimoto <ba...@hawaii.edu> on 2023/09/22 18:58:01 UTC

localhost log config?

I hope someone can help me with a  Tomcat (10.1.x)  logging configuration
question.

I'm perplexed trying to figure out the logging configuration for the
localhost log. I'm using an external logrotate utility to handle log
rotation. This is working well for other Tomcat logs such as catalina.out,
access.log, etc, but for our localhost log, Tomcat seems to be creating
them with the date Tomcat was started in the log filename, and I don't know
why or how to change this behavior. Our logrotate utility expects a
predictable logfile name, such as localhost.log, and the addition of the
date in the filename breaks that.

I have the following defined in our logging.properties file:

1catalina.org.apache.juli.AsyncFileHandler.level      = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory  =
${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix     = catalina
1catalina.org.apache.juli.AsyncFileHandler.encoding   = UTF-8
1catalina.org.apache.juli.AsyncFileHandler.rotatable  = false

2localhost.org.apache.juli.AsyncFileHandler.level     = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory =
${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix    = localhost
2localhost.org.apache.juli.AsyncFileHandler.encoding  = UTF-8
2localhost.org.apache.juli.FileHandler.rotatable      = false

If I restart Tomcat today, for example, I wind up
with localhost2023-09-22.log

I'm not sure why this works as expected with the catalina log files, but
not localhost. Presumably I have a misconception about how this is supposed
to work or some other basic error?
-- 
Baron Fujimoto <ba...@hawaii.edu> ::: UH Information Technology Services
minutas cantorum, minutas balorum, minutas carboratum descendus pantorum

Re: localhost log config?

Posted by Baron Fujimoto <ba...@hawaii.edu>.
Doh! Well, that was a dumb mistake. Mahalo for pointing out the obvious.

On Sat, Sep 23, 2023 at 9:06 PM Konstantin Kolinko <kn...@gmail.com>
wrote:

> пт, 22 сент. 2023 г. в 21:59, Baron Fujimoto <ba...@hawaii.edu>:
> >
> >[...]
> >
> > I have the following defined in our logging.properties file:
> >
> > 1catalina.org.apache.juli.AsyncFileHandler.rotatable  = false
> >
> > 2localhost.org.apache.juli.FileHandler.rotatable      = false
> >
> > [...]
> > I'm not sure why this works as expected with the catalina log files, but
> not localhost.
>
> Note that "2localhost" setting has a typo:
> s/FileHandler/AsyncFileHandler/
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Baron Fujimoto <ba...@hawaii.edu> ::: UH Information Technology Services
minutas cantorum, minutas balorum, minutas carboratum descendus pantorum

Re: localhost log config?

Posted by Konstantin Kolinko <kn...@gmail.com>.
пт, 22 сент. 2023 г. в 21:59, Baron Fujimoto <ba...@hawaii.edu>:
>
>[...]
>
> I have the following defined in our logging.properties file:
>
> 1catalina.org.apache.juli.AsyncFileHandler.rotatable  = false
>
> 2localhost.org.apache.juli.FileHandler.rotatable      = false
>
> [...]
> I'm not sure why this works as expected with the catalina log files, but
not localhost.

Note that "2localhost" setting has a typo:
s/FileHandler/AsyncFileHandler/

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org