<logger name="audit">
<appender-ref ref="AuditAppender"/>
</logger>
<logger name="com">
<appender-ref ref="GeneralAppender"/>
</logger>
On 3/19/06, Rakesh Patel <[EMAIL PROTECTED]> wrote:
> can you give an example of how the xml config file would look? Are you
> saying there's some regular expression i can take advantage of to attach
> the appropriate appender to the audit loggers?
>
> Thanks
>
> Rakesh
>
> James Stauffer wrote:
>
> >Attach one appender to the audit logger and a different category to
> >the other logger (com?)
> >
> >On 3/17/06, Rakesh Patel <[EMAIL PROTECTED]> wrote:
> >
> >
> >>so i have another logger but how do i control loggers output to a
> >>specific appender?
> >>
> >>cheers
> >>
> >>Rakesh
> >>
> >>James Stauffer wrote:
> >>
> >>
> >>
> >>>Do it like the following. Then it will be easy to send the audit logs
> >>>to another location.
> >>>
> >>>final static Logger _logger = Logger.getLogger(ReferenceDataDaoImpl.class);
> >>>final static Logger _auditor =
> >>>Logger.getLogger("audit."ReferenceDataDaoImpl.class.getName());
> >>>
> >>>
> >>>On 3/17/06, Rakesh Patel <[EMAIL PROTECTED]> wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>Hi,
> >>>>
> >>>>i have a requirement to audit events to a database table. I thought of
> >>>>using the log4j JdbcAppender to do this but the issue i have is there's
> >>>>auditing and there's debugging.
> >>>>
> >>>>For example,
> >>>>
> >>>>logger.debug("Value of variable is now:{}",aVariable); // this is not
> >>>>needed for auditing
> >>>>logger.debug("Successful logon for username:{}",userName); // this
> >>>>should end up in the audit table
> >>>>
> >>>>My current configuration of log4j is to declare a class-specific logger
> >>>>in each class that needs logging:
> >>>>
> >>>>final static Logger _logger =
> >>>>Logger.getLogger(ReferenceDataDaoImpl.class);
> >>>>
> >>>>I could use this logger and utilise thresholds and have audit events
> >>>>triggered by calling logger.error() but that does not seem a very clean
> >>>>approach.
> >>>>
> >>>>Another idea is to declare an additional logger to be used for auditing:
> >>>>
> >>>>final static Logger _logger =
> >>>>Logger.getLogger(ReferenceDataDaoImpl.class);
> >>>>final static Logger _auditor =
> >>>>Logger.getLogger(ReferenceDataDaoImpl.class);
> >>>>
> >>>>and have that logger use JdbcAppender. Or maybe one global logger for
> >>>>auditing?
> >>>>
> >>>>What do you guys think?
> >>>>
> >>>>Cheers
> >>>>
> >>>>Rakesh
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>--
> >>>James Stauffer
> >>>Are you good? Take the test at http://www.livingwaters.com/good/
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >
> >
> >--
> >James Stauffer
> >Are you good? Take the test at http://www.livingwaters.com/good/
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]