[GLASSFISH-19323] log service should only add handlers configures in j.u.l. logging.properties file. Created: 13/Nov/12  Updated: 08/Feb/13  Resolved: 08/Feb/13

Status: Resolved
Project: glassfish
Component/s: logging
Affects Version/s: 4.0_b62_ms6
Fix Version/s: 4.0_b73

Type: Bug Priority: Major
Reporter: Sanjeeb Sahoo Assignee: sandeep.shrivastava
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Currently gf log service adds any HK2 service that has a contract of type j.u.l.Handler. Instead, it should only add those handlers that are explicitly configured in handlers property in logging.properties file. Mind you, it still has to discover the handlers using HK2 service locator otherwise it would fail to load handler classes from modules.



 Comments   
Comment by sandeep.shrivastava [ 04/Jan/13 ]

Sanjeeb,

Can you provide further details on the use case and the problem caused by this behavior? Please
note that there might be some compatibility concerns if we change the functionality as per your request as some folks may be implicitly relying on the Handler to be added automatically via the Service discovery.

Thanks

Sandeep

Comment by sandeep.shrivastava [ 11/Jan/13 ]

Sahoo,

Please provide further clarification as per prior post.

Thanks

Sandeep

Comment by sandeep.shrivastava [ 07/Feb/13 ]

Looks like this is a documented feature.

http://docs.oracle.com/cd/E18930_01/html/821-2416/gklmn.html#ghmen

We are thinking of defining a separate properties called handlerServices in the logging.properties file where such Hk2 handlers can be registered explicitly. These handler services will be attached to the root logger.

This may affect existing users of this feature, so we will need to release note it.

Comment by sandeep.shrivastava [ 07/Feb/13 ]

Users will be able to configure custom handlers in two ways.

1. Implement a java.util.logging.Handler and include it in a jar which is dropped in the domain/lib/ext dir. They can configure the handlers property in the logging.properties file to attach the handler to the root logger.

2. Implement a Handler as a java.util.logging.Handler HK2 Service and deploy an OSGI module. Such handlers can be configured by the specifying the handlerServices property in the logging.properties file.

These 2 usage patterns will need to be documented.

Comment by sandeep.shrivastava [ 08/Feb/13 ]

Committed revision 59320.

Generated at Sat Mar 28 23:13:58 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.