Ole Ersoy schrieb:
Hi,

I would really appreciate it if someone could elaborate on the case for these logging properties:

############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = \
  3manager.org.apache.juli.FileHandler

For example what additional logging capabilities does the above give in the context of these properties:

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager] is the name of a logger, in this case the name of the logger associated with the context /manager in host localhost in Engine Catalina.

Most loggers get their names from class names, but context loggers are special cases.

The logger here is configured to log only messages at or above level INFO. They will be output by the handler 3manager.org.apache.juli.FileHandler.

Also there's this part:

# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
#org.apache.catalina.startup.ContextConfig.level = FINE
#org.apache.catalina.startup.HostConfig.level = FINE
#org.apache.catalina.session.ManagerBase.level = FINE

Should the left side of the equal sign be SEVERE in the above cases (I'll put in a documentation ticket, just making sure)? Seems like these are setting the log level directly on the Logger for the classes listed.

Would it be better to have something like this in the documentation:

# For example, set the org.apache.catalina.session.ManagerBase logger to only log SEVERE
# messages:
#org.apache.catalina.session.ManagerBase.level = SEVERE

?

Yes, would be more logical. The one thing is the comment should fit the example, on the other hand the given example is one, that people might actually use.

Also, assuming that the log level is set directly on the logger, does that buy anything? From what I understand the logger has to delegate to a handler eventually, and then the handlers level takes precedence...so is there a point to setting it directly on the Logger?

Loggers usually check their configured log level before calling the log method (for FINE/FINEST, resp. DEBUG/TACE). The way this is done, is that the developer using the logger checks with an if statement, if the level is at least the one the message has. That way, the message doesn't need to be concatenated as a string when the configured level will not generate the message. This is especially important for debug messages. The developer has no possibility to check the handlers level in the code, because the handler as an object is more in the realm of the administrator).

Another agument, that applies not to juli, but to other log frameworks. You could send log messages to various handlers, one of them logs everything above INFO, and another one above ERROR. To do such a thing, logger log level and handler log level need to be defined independently.

Thanks,
- Ole

Regards,

Rainer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to