0

我有一个包含 CustomLoginModule 的 jar 来执行 JAAS 授权。这个罐子位于${CATALINA_BASE}/lib. 我有一个org.apache.juli.logging.Log对象可以在不同级别的模块中执行日志记录。我想要一个日志文件,例如jaas.log写入模块日志的地方,而不是将它们放在Catalina.outorcatalina.log中。这是我的logging.properties文件,使用此配置,我可以创建它,jaas.log但它保持为空,所有日志都转到了Catalina.outcatalina.log有人可以帮忙吗?非常感谢。

logging.properties文件:

handlers = 1catalina.org.apache.juli.FileHandler,          
2localhost.org.apache.juli.FileHandler,   
3manager.org.apache.juli.FileHandler, 4host-
manager.org.apache.juli.FileHandler, 5jaasauth.org.apache.juli.FileHandler
#, java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler,   
5jaasauth.org.apache.juli.FileHandler
#.handlers = 1catalina.org.apache.juli.FileHandler,    
java.util.logging.ConsoleHandler, 5jaasauth.org.apache.juli.FileHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

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

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

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

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


5jaasauth.org.apache.juli.FileHandler.level = ALL
5jaasauth.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5jaasauth.org.apache.juli.FileHandler.prefix =jaas-auth.


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

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =    
2localhost.org.apache.juli.FileHandler

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

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-mana 
ger].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-  
manager].handlers = 4host-manager.org.apache.juli.FileHandler


com.mymodule.apps.orchestration.CustomLdapLoginModule.level = ALL
com.mymodule.apps.CustomLdapLoginModule.handlers =     
5jaasauth.org.apache.juli.FileHandler
4

0 回答 0