0

I have a simple question where I still can not find any answer. I want to log messages into a separate log file. I am using Java logging and not log4j.

I have the following class:

package org.imixs.workflow;
public class MailPlugin  {
 ....
      private static Logger logger = Logger.getLogger(MailPlugin.class.getName());
 ...
 logger.info("some info...");
}

I am using GlassFish server. So I need to customize the settings in the logger.properties file from GlassFish.

What entries need to be added to the GlassFish logger.properties file to log all messages from my class 'MailPlugin' into a separate log file?

1 Answer 1

1

You can create a file appender and apply a Filter to it that only returns true when it the logging is coming from the MailPlugin

Sign up to request clarification or add additional context in comments.

2 Comments

But is it not possible to configure this only via logger.properties file? I have multiple classes in different jar modules which all depend to on package 'org.imixs.workflow' and I would like to redirect those messages into on log file without modifying my code.
You will have to at least write the filter class. But then you should be able to apply the filter to the logger in the properties file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.