I'm running an application on GlassFish 4. I would like to have more than one logfile, so that I can log messages processed in MDBs(Message driven bean) into a special log file and not into the general Glassfish logfile. How can I do that?
Asked
Active
Viewed 129 times
1 Answers
1
The Glassfish 4.0 Administration Guide Section 7 describes how to configure logging service. For the root of your MDB logger namespace you have to turn off Logger.setUseParentHandlers to prevent writting to the default log. Then attach a FileHandler or a com.sun.enterprise.server.logging.GFFileHandler at the root of your MDB logger namespace to capture the output. The LogManager documentation describes how namespaces work.

jmehrens
- 10,580
- 1
- 38
- 47
-
I need to add a HK2 component for my custom logger, but I don't know how to do it, see: http://stackoverflow.com/questions/25268183/writing-hk2-components-in-glassfish-4 – Roland Aug 12 '14 at 15:24