Yes.  Use a Marker on your Audit events and then add a global filter that 
accepts events with those Markers.

Ralph

On Aug 4, 2014, at 8:00 AM, Matt Sicker <[email protected]> wrote:

> Take a look at the EventLogger:
> 
> http://logging.apache.org/log4j/2.x/manual/eventlogging.html
> 
> Javadocs:
> http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/EventLogger.html
> http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/message/StructuredDataMessage.html
> http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/ThreadContext.html
> 
> 
> On 4 August 2014 09:08, Rebecca Ahlvarsson <[email protected]> wrote:
> I am interested in using log4j for audit logging, in other words, I will open 
> my own file and start logging anything I want. Therefore I do NOT want to use 
> warn, info or any log level. Something like that:
> 
> Log log = new Log("blah.txt");
> log.log("Test");
> log.close();
> 
> How can I do that with LOG4J?
> 
> A concrete example that I can run will be very appreciated.
> 
> Thanks,
> 
> Rebecca Ahlvarsson
> 
> 
> 
> 
> -- 
> Matt Sicker <[email protected]>

Reply via email to