![]() Add your own handler class like 'handlers=, customhandler.NewHandler'. Make changes in default logging.properties file as mentioned above. Copy 'customhandler.jar' under GF_HOME/glassfish/domains/domain1/lib/ext folder.ģ. Compile the same and create jar for the same (e.g. ![]() Write your own custom handler as defined above 'NewHandler.java'. Changes needed under logging.properties file (GF_HOME/glassfish/domains/domain1/config): #GlassFish logging.properties list #Mon Mar 16 22:32: .admin.level=INFO handlers=, customhandler.NewHandler .formatter=.logging.UniformLogFormatter =INFOġ. I also changed the output format for logging data under mylogging.log file(Check publish(LogRecord record)function).Ģ. In above sample I am logging data under '/space/output/mylogging.log'. Sample Handler (NewHandler.java): package customhandler /** * naman mehta */ import java.io.BufferedWriter import java.io.FileWriter import java.io.IOException import import /** * New Handler */ public class NewHandler extends Handler In the examples below I log messages to a specific file in different format but you can replace that code with something that interests you.ġ. It is pretty straight forward you can add the handler, a Java class as specified by the JDK. This can be done by writing a custom log handler. ![]() You may find that you want to log messages to a database, send them to a remote server or log messages from specific loggers to your own file. How do I configure my Custom Log Handler in GlassFish 3.1?īy default GlassFish logs data under server.log using pre-defined format.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |