Cl?ment OUDOT wrote:
>> The class org.interldap.lsc.utils.LocalizedJndiModificationsLayout
>> outputs directory modifications as LDIF. Is this not what you want?
> 
> The pb is: it just not output only LDIF data ! So the logfile cannot be
> used with ldapadd/ldapmodify.
> 
> And LDIF data don't need a "LocalizedJndiModificationsLayout", so that's
> why I proposed to code a new logger, dedicated to LDIF output, and to keep
> standard message in the first logger.

Indeed. R?my-Christophe just commited a small property in
"LocalizedJndiModificationsLayout" so you can choose to output only LDIF.

A sample LOG4J configuration to do this is the following:
8<-------------------------------------------------------
log4j.appender.CONSOLE = org.apache.log4j.FileAppender
log4j.appender.CONSOLE.file = /tmp/updates.ldif
log4j.appender.CONSOLE.layout = \
org.interldap.lsc.utils.LocalizedJndiModificationsLayout
log4j.appender.CONSOLE.layout.onlyLdif = true
8<-------------------------------------------------------

>>>>> Have some docs on level used and messages ?
>>>> There are no LSC-specific docs on logs. However, since we use log4j for
>>>> logging, there are some docs on the internet about configuring log4j...
>>>> probably not what you really need here though!
>>> No I want to give info for exploitation, so it concerns log contents.
>>> Waht
>>> do I see when i put warn level, debug level, ... ?
>> I don't really know how to answer this question.
>>
>> Available levels are DEBUG, INFO, WARN, ERROR and FATAL. From right to
>> left, you get more and more information about what LSC is doing.
>>
>> Anything below WARN is just for information only, and can help analyze
>> problems. Details of modifications (such as LDIF output as discussed
>> above) are at the INFO level.
> 
> Ok, I know how loglevels work,

Hehe, sorry :)

> but the question was to obtain a list of
> error messages generated with LSC and their associated loglevel. It's a
> documentation we need for exmplotation. Dependinf on my time, I will have
> a look at this.

We don't have a full list at the moment. I just grepped the code like this:
grep -rH "LOGGER\." src/ | grep -v "/.svn/" sed
"s/.*\(LOGGER\..*$\)/\1/" | sort | uniq

And here are some stats:
TOTAL           140 different messages
FATAL           16
ERROR           58
WARN            16
INFO            21
DEBUG           27

So there are quite a few different messages. Some more grepping shows
that 43 messages only happen during generation, and 3 during tests. Just
to get an idea...

Jon

Reply via email to