You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "nick faiz (JIRA)" <di...@incubator.apache.org> on 2005/06/26 16:38:57 UTC

[jira] Created: (DIREVE-171) add log4j config patch

add log4j config patch
----------------------

         Key: DIREVE-171
         URL: http://issues.apache.org/jira/browse/DIREVE-171
     Project: Directory Server
        Type: Improvement
  Components: server main  
    Versions: 0.9.1    
    Reporter: nick faiz
 Assigned to: Alex Karasulu 
    Priority: Trivial
 Attachments: log4j.properties, logging_patch.txt

Please find enclosed a patch (diff file) and a log4j.properties file.

You should create a src/etc directory for main and core and place the properties file there.

Cheers,
Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Nick Faiz <ni...@gmail.com>.
All,

Here's the URL I mentioned - http://wiki.apache.org/directory/LoggingPlan 

I'll go ahead and start doing this - if someone has feedback please let me know.

Cheers,
Nick

  

On 7/27/05, Nick Faiz <ni...@atlassian.com> wrote:
> 
> Actually, to make things transparent I will create a logging plan page,
> on the wiki, outlining the ideas I have in mind and asking for feedback
> from others, including best usages (such as log.debug("hello {}",
> getName()) ), etc.. I'll post a list to the URL when it's there.
> 
> Hopefully, this will make things clearer. I'll use the project's wiki.
> 
> Cheers,
> Nick
> 
> 
> Nick Faiz wrote:
> > Hi Ceki,
> >
> > Thanks for paying attention to our use of slf4j. I agree with you.
> > Please remember, though, that this is just a patch which provides one
> > thing - a configuration for slf4j which works for development.
> >
> > The patch attached to DIREVE171 is a simple step forward - it is not
> > the entire logging picture. So far it's taken 5 weeks to apply this
> > one, small thing. I want to get it through before raising further
> > logging ideas, which could take more time.
> >
> > Further work on logging will occur in subsequent patches, however, and
> > I'll be discussing it with the list. If you would be interested in
> > providing feedback then I would obviously welcome it.
> >
> > Cheers,
> > Nick
> >
> >
> >
> >
> > On 7/26/05, Ceki Gülcü <li...@qos.ch> wrote:
> >
> >>Hi Nick,
> >>
> >>I might be completely off base in this particular case, but in
> >>general, a library-type component should NOT configure log4j and let
> >>the user do it. Of course, you can still document logging in your
> >>library, in particular by providing one or more sample configuration
> >>files. The point is that you should not *impose* a log4j config file
> >>on the end-user.
> >>
> >>In the case of application (and not a library), you can provide a
> >>default log4j configuration file, but you should be careful to allow
> >>the end-user change it if she wants to.
> >>
> >>As basic rule of thumb, you should view logging mostly as an end-user
> >>concern. I hope these general remarks are helpful to you rather than a
> >>distraction,
> >>
> >>
> >>At 12:55 PM 7/26/2005, Nick Faiz wrote:
> >>
> >>>Hi Ceki,
> >>>
> >>>Yes, that sounds like a good idea.
> >>>
> >>>Right now, imo, the main issue is to get the logging configuration in
> >>>place - as a dependency in project.xml for apacheds, so people can use
> >>>it. Afterwards, the pattern layout can change, the logging statements
> >>>can be altered.
> >>>
> >>>The 'Better alternative based on format messages' in
> >>>http://www.slf4j.org/faq.html#2.3 looks really good.
> >>>
> >>>Cheers,
> >>>Nick
> >>
> >>--
> >>Ceki Gülcü
> >>
> >>   The complete log4j manual: http://www.qos.ch/log4j/
> >>
> >>
> >>
> >
> >
> 
> 
> --
> ATLASSIAN - http://www.atlassian.com/
> 
> Confluence - the enterprise wiki - tried it yet?
> http://www.atlassian.com/confluence/
> --
>

Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Nick Faiz <ni...@atlassian.com>.
Actually, to make things transparent I will create a logging plan page, 
on the wiki, outlining the ideas I have in mind and asking for feedback 
from others, including best usages (such as log.debug("hello {}", 
getName()) ), etc.. I'll post a list to the URL when it's there.

Hopefully, this will make things clearer. I'll use the project's wiki.

Cheers,
Nick


Nick Faiz wrote:
> Hi Ceki,
>  
> Thanks for paying attention to our use of slf4j. I agree with you.
> Please remember, though, that this is just a patch which provides one
> thing - a configuration for slf4j which works for development.
> 
> The patch attached to DIREVE171 is a simple step forward - it is not
> the entire logging picture. So far it's taken 5 weeks to apply this
> one, small thing. I want to get it through before raising further
> logging ideas, which could take more time.
> 
> Further work on logging will occur in subsequent patches, however, and
> I'll be discussing it with the list. If you would be interested in
> providing feedback then I would obviously welcome it.
> 
> Cheers,
> Nick 
> 
> 
> 
> 
> On 7/26/05, Ceki Gülcü <li...@qos.ch> wrote:
> 
>>Hi Nick,
>>
>>I might be completely off base in this particular case, but in
>>general, a library-type component should NOT configure log4j and let
>>the user do it. Of course, you can still document logging in your
>>library, in particular by providing one or more sample configuration
>>files. The point is that you should not *impose* a log4j config file
>>on the end-user.
>>
>>In the case of application (and not a library), you can provide a
>>default log4j configuration file, but you should be careful to allow
>>the end-user change it if she wants to.
>>
>>As basic rule of thumb, you should view logging mostly as an end-user
>>concern. I hope these general remarks are helpful to you rather than a
>>distraction,
>>
>>
>>At 12:55 PM 7/26/2005, Nick Faiz wrote:
>>
>>>Hi Ceki,
>>>
>>>Yes, that sounds like a good idea.
>>>
>>>Right now, imo, the main issue is to get the logging configuration in
>>>place - as a dependency in project.xml for apacheds, so people can use
>>>it. Afterwards, the pattern layout can change, the logging statements
>>>can be altered.
>>>
>>>The 'Better alternative based on format messages' in
>>>http://www.slf4j.org/faq.html#2.3 looks really good.
>>>
>>>Cheers,
>>>Nick
>>
>>--
>>Ceki Gülcü
>>
>>   The complete log4j manual: http://www.qos.ch/log4j/
>>
>>
>>
> 
> 


-- 
ATLASSIAN - http://www.atlassian.com/

Confluence - the enterprise wiki - tried it yet?
http://www.atlassian.com/confluence/
--

Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Nick Faiz <ni...@gmail.com>.
Hi Ceki,
 
Thanks for paying attention to our use of slf4j. I agree with you.
Please remember, though, that this is just a patch which provides one
thing - a configuration for slf4j which works for development.

The patch attached to DIREVE171 is a simple step forward - it is not
the entire logging picture. So far it's taken 5 weeks to apply this
one, small thing. I want to get it through before raising further
logging ideas, which could take more time.

Further work on logging will occur in subsequent patches, however, and
I'll be discussing it with the list. If you would be interested in
providing feedback then I would obviously welcome it.

Cheers,
Nick 




On 7/26/05, Ceki Gülcü <li...@qos.ch> wrote:
> 
> Hi Nick,
> 
> I might be completely off base in this particular case, but in
> general, a library-type component should NOT configure log4j and let
> the user do it. Of course, you can still document logging in your
> library, in particular by providing one or more sample configuration
> files. The point is that you should not *impose* a log4j config file
> on the end-user.
> 
> In the case of application (and not a library), you can provide a
> default log4j configuration file, but you should be careful to allow
> the end-user change it if she wants to.
> 
> As basic rule of thumb, you should view logging mostly as an end-user
> concern. I hope these general remarks are helpful to you rather than a
> distraction,
> 
> 
> At 12:55 PM 7/26/2005, Nick Faiz wrote:
> >Hi Ceki,
> >
> >Yes, that sounds like a good idea.
> >
> >Right now, imo, the main issue is to get the logging configuration in
> >place - as a dependency in project.xml for apacheds, so people can use
> >it. Afterwards, the pattern layout can change, the logging statements
> >can be altered.
> >
> >The 'Better alternative based on format messages' in
> >http://www.slf4j.org/faq.html#2.3 looks really good.
> >
> >Cheers,
> >Nick
> 
> --
> Ceki Gülcü
> 
>    The complete log4j manual: http://www.qos.ch/log4j/
> 
> 
>

Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Ceki Gülcü <li...@qos.ch>.
Hi Nick,

I might be completely off base in this particular case, but in
general, a library-type component should NOT configure log4j and let
the user do it. Of course, you can still document logging in your
library, in particular by providing one or more sample configuration
files. The point is that you should not *impose* a log4j config file
on the end-user.

In the case of application (and not a library), you can provide a
default log4j configuration file, but you should be careful to allow
the end-user change it if she wants to.

As basic rule of thumb, you should view logging mostly as an end-user
concern. I hope these general remarks are helpful to you rather than a
distraction,


At 12:55 PM 7/26/2005, Nick Faiz wrote:
>Hi Ceki,
>
>Yes, that sounds like a good idea.
>
>Right now, imo, the main issue is to get the logging configuration in
>place - as a dependency in project.xml for apacheds, so people can use
>it. Afterwards, the pattern layout can change, the logging statements
>can be altered.
>
>The 'Better alternative based on format messages' in
>http://www.slf4j.org/faq.html#2.3 looks really good.
>
>Cheers,
>Nick

-- 
Ceki Gülcü

   The complete log4j manual: http://www.qos.ch/log4j/



Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Nick Faiz <ni...@gmail.com>.
Hi Ceki,
   
Yes, that sounds like a good idea. 

Right now, imo, the main issue is to get the logging configuration in
place - as a dependency in project.xml for apacheds, so people can use
it. Afterwards, the pattern layout can change, the logging statements
can be altered.

The 'Better alternative based on format messages' in
http://www.slf4j.org/faq.html#2.3 looks really good.

Cheers,
Nick

On 7/26/05, Ceki Gulcu (JIRA) <di...@incubator.apache.org> wrote:
>     [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12316730 ]
> 
> Ceki Gulcu commented on DIREVE-171:
> -----------------------------------
> 
> Nick,
> 
> I appreciate your work on setting up nlog4j at ibiblio. Thank you.
> 
> You might want to consider using format patterns as described  in [1, 2].
> Just to let you know an alternative exists,
> 
> [1] http://www.slf4j.org/manual.html  (see section "Typical usage pattern")
> [2] http://www.slf4j.org/faq.html#2.3
> 
> Cheers,
> 
> > add log4j config patch
> > ----------------------
> >
> >          Key: DIREVE-171
> >          URL: http://issues.apache.org/jira/browse/DIREVE-171
> >      Project: Directory Server
> >         Type: Improvement
> >   Components: server main
> >     Versions: 0.9.1
> >     Reporter: Nick Faiz
> >     Assignee: Alex Karasulu
> >     Priority: Trivial
> >  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt, logging_patch_3.txt
> >
> > Please find enclosed a patch (diff file) and a log4j.properties file.
> > You should create a src/etc directory for main and core and place the properties file there.
> > Cheers,
> > Nick
> 
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
> 
>

[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314759 ] 

Nick Faiz commented on DIREVE-171:
----------------------------------

Hi Alex,
   Just for convenience. I know that it works. I only discovered just now that a 1.2.9 was available at ibiblio- http://www.ibiblio.org/maven/log4j/jars/ . If 1.3 is the latest it'd be the one to try.

   I'll read through http://www.qos.ch/logging/sc.jsp , r.e. Repository Selectors, on the weekend.

Cheers,
Nick

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314756 ] 

Alex Karasulu commented on DIREVE-171:
--------------------------------------

Why use log4j 1.2.XXX rather than the 1.3? Just curious.

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314509 ] 

Nick Faiz commented on DIREVE-171:
----------------------------------

  Modifications include adding a preGoal for the 'jar:jar' goal to
the maven.xml of each project to ensure that the log4j.properties is
within the build jar. This preGoal assumes that the log4j.properties
file can be found in main/src/etc/ and core/src/etc/ .

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIREVE-171) add log4j config patch

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-171?page=all ]

Nick Faiz updated DIREVE-171:
-----------------------------

    Attachment: log_patch2.txt

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by nickf <ni...@gmail.com>.
Here's my 2 cents ...

Configurable logging in a 24/7 server sounds like a good idea,
probably a necessity. I think it'd take more thought than using the
logging code involved with building the server. It might even be
something separate.

Cheers,
Nick

On 6/27/05, Emmanuel Lecharny <el...@apache.org> wrote:
> > Is this really the recommended way of doing things? That means I can't easily
> > change the Level while the application is running.
> 
> It applies to debug, not to info. Whatever,not using it  it's not a big
> deal, as using isDebugEnabled is good enough !
> 
> >
> > Especially for a 24/7 server system as ApacheDS, this should be of special
> > concern, don't you think.
> 
> I don't think so, but I may be wrong. I do think that debug is for debug
> purpose, when writing code (I mean, when in production, it's too late to
> run in debug mode). So if you have a problem, you should isolate the
> data that produce it, and then, debug it on a special environment,
> setting the level to debug.
> 
> A few years ago, when working on a system that crashed in prod, I
> suggested to put on the debug level. I got 2,5 Gb of logs in half an
> hour. I can tell by experience (I spent hours reading those useless
> lines of logs) that it does not help at all...
> 
> cheers,
> Emmanuel Lécharny
> 
> 
>

Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Emmanuel Lecharny <el...@gmail.com>.
> Well, it may not be easy to "isolate" without turning debugging on. I am in 
> the camp who have far too much debug statements turned on "always" to have a 
> chance to figure out "what went wrong" afterwards. Of course, sometimes that 
> is not feasible, and that is when the dynamic settings of Level is useful.

This can be debated for years, and sure it will be ! Whatever, let's
stop this discussion : I admit that those are valid points. Let's not
use DEBUG, the gain is so small that it's much more a theorical question
to use it against using "if (log.isDebugEnabled())"

> The "logger.isDebugEnabled()" is cheap enough to be used for each invocation, 
> and provides the possibility for dynamic level settings in the logging 
> system.

I fully agree.

Being pragmatic helps a lot, when in production ;-)


Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Monday 27 June 2005 14:51, Emmanuel Lecharny wrote:
> I don't think so, but I may be wrong. I do think that debug is for debug
> purpose, when writing code (I mean, when in production, it's too late to
> run in debug mode). So if you have a problem, you should isolate the
> data that produce it, and then, debug it on a special environment,
> setting the level to debug.

Well, it may not be easy to "isolate" without turning debugging on. I am in 
the camp who have far too much debug statements turned on "always" to have a 
chance to figure out "what went wrong" afterwards. Of course, sometimes that 
is not feasible, and that is when the dynamic settings of Level is useful.


> A few years ago, when working on a system that crashed in prod, I
> suggested to put on the debug level. I got 2,5 Gb of logs in half an
> hour. I can tell by experience (I spent hours reading those useless
> lines of logs) that it does not help at all...

:o)  Well, Chainsaw could have made your life a lot easier. Also, it wouldn't 
be that much data if 'selective enabling' is done, such as a handful of 
Loggers at a time.

The "logger.isDebugEnabled()" is cheap enough to be used for each invocation, 
and provides the possibility for dynamic level settings in the logging 
system.


Cheers
Niclas

Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Emmanuel Lecharny <el...@apache.org>.
> Is this really the recommended way of doing things? That means I can't easily 
> change the Level while the application is running.

It applies to debug, not to info. Whatever,not using it  it's not a big
deal, as using isDebugEnabled is good enough !

> 
> Especially for a 24/7 server system as ApacheDS, this should be of special 
> concern, don't you think.

I don't think so, but I may be wrong. I do think that debug is for debug
purpose, when writing code (I mean, when in production, it's too late to
run in debug mode). So if you have a problem, you should isolate the
data that produce it, and then, debug it on a special environment,
setting the level to debug.

A few years ago, when working on a system that crashed in prod, I
suggested to put on the debug level. I got 2,5 Gb of logs in half an
hour. I can tell by experience (I spent hours reading those useless
lines of logs) that it does not help at all... 

cheers, 
Emmanuel Lécharny



Re: [jira] Commented: (DIREVE-171) add log4j config patch

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Sunday 26 June 2005 23:11, Emmanuel Lecharny (JIRA) wrote:
> Even better, add a
> private static final boolean DEBUG = log.isDebugEnabled();
>
> and use it this way :
>
> if (DEBUG)
> {
>    log.debug(...)
> }
>
> As DEBUG will be evaluated only once, the test is faster (no function
> called).

Just a quick question...

Is this really the recommended way of doing things? That means I can't easily 
change the Level while the application is running.

Especially for a 24/7 server system as ApacheDS, this should be of special 
concern, don't you think.


Cheers
Niclas

[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Emmanuel Lecharny (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314510 ] 

Emmanuel Lecharny commented on DIREVE-171:
------------------------------------------

Hi, Nick,

could you modify your patch a little bit? The Category class is deprecated (http://www.docjar.com/docs/api/org/apache/log4j/Category.html)
Logger is the class to use.

Is this also possible that you add a test before eacjh log.debug call ?

log.debug( "Search attempt using filter '" + filter + "' "
             + "with scope '" + scope + "' and a return limit of '" + limit
             + "'" );

is expensive as the string is built even if we are not in debug mode.

It's better to write :

if (log.isDebugEnabled()) 
{
    log.debug(...)
}

Even better, add a 
private static final boolean DEBUG = log.isDebugEnabled();

and use it this way :

if (DEBUG)
{
   log.debug(...)
}

As DEBUG will be evaluated only once, the test is faster (no function called).

Thanks a lot !

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DIRSERVER-473) add log4j config patch

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-473?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny closed DIRSERVER-473.
---------------------------------------


Closing all issues created in 2005 and before which are marked resolved

> add log4j config patch
> ----------------------
>
>                 Key: DIRSERVER-473
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-473
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>            Reporter: Nick Faiz
>         Assigned To: Alex Karasulu
>            Priority: Trivial
>         Attachments: log4j.properties, log_patch2.txt, logging_patch.txt, logging_patch_3.txt
>
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIREVE-171) add log4j config patch

Posted by "Alex Karasulu (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-171?page=all ]
     
Alex Karasulu resolved DIREVE-171:
----------------------------------

    Fix Version: 0.9.1
     Resolution: Fixed

Committed revision 225440.

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>      Fix For: 0.9.1
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt, logging_patch_3.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIREVE-171) add log4j config patch

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-171?page=all ]

Nick Faiz updated DIREVE-171:
-----------------------------

    Attachment: logging_patch_3.txt

Please find attached a configuration for nlog4j, relying on the org.slf4j.Logger interface.

The logging configuration relies upon a log4j.properties file being present in main/src/etc (a directory which should be created). The project.xml states that main/src/etc/log4j.properties is a resource for the source build (handy for including stuff on the classpath in IDEA, probably Eclipse too).

The apacheds project.xml now expresses this dependency - so main, shared, and core will pick it up too.

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>nlog4j</artifactId>
        <version>1.2.14</version>
        <url>http://slf4j.org/nlog4j</url>
      </dependency>

Cheers all,
Nick


> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt, logging_patch_3.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Emmanuel Lecharny (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314778 ] 

Emmanuel Lecharny commented on DIREVE-171:
------------------------------------------

Hi guys,

The current version is 1.2.11. The next one will be 1.3, and is expected to be out on October.

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Ceki Gulcu (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12316730 ] 

Ceki Gulcu commented on DIREVE-171:
-----------------------------------

Nick,

I appreciate your work on setting up nlog4j at ibiblio. Thank you.

You might want to consider using format patterns as described  in [1, 2].
Just to let you know an alternative exists,  

[1] http://www.slf4j.org/manual.html  (see section "Typical usage pattern")
[2] http://www.slf4j.org/faq.html#2.3

Cheers,

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt, logging_patch_3.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Emmanuel Lecharny (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314523 ] 

Emmanuel Lecharny commented on DIREVE-171:
------------------------------------------

Hi Nick, 

in MainFrame.class, I think that keeping the code this way should be enough :

 ... else if ( mode == FilterDialog.DEBUG_MODE )
            {
                    log.debug( "Search attempt using filter '" + dialog.getFilter() + "' "
                        + "with scope '" + dialog.getScope() + "' and a return limit of '"
                            + dialog.getLimit() + "'" );

            }

You already have a test on the level, so do not care about the string being built. 

Anyway, yes, I think there is an inconstency about debug level used in log4j and FilterDialog.

Be  aware that the little optimization I suggested is better suited for server side, not for GUI. So use it when you think it fits your need. Personnaly, I found it confortable to use it everywhere, because it don't arm (except when you want to switch to debug dynamically).

About your last question, I don't know. This is up to you to decide if it should !

Keep up the good job ! We need guys like you working on those pieces of code !

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DIREVE-171) add log4j config patch

Posted by "nick faiz (JIRA)" <di...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/DIREVE-171?page=all ]

nick faiz updated DIREVE-171:
-----------------------------

    Attachment: logging_patch.txt
                log4j.properties

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: nick faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIREVE-171) add log4j config patch

Posted by "Nick Faiz (JIRA)" <di...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/DIREVE-171?page=comments#action_12314520 ] 

Nick Faiz commented on DIREVE-171:
----------------------------------

Hi Emmanuel,
   Good idea! Thanks for making me not be lazy. :) 

   There seems to be a logical inconsistency between the MainFrame class, which uses FilterDialog's own logging settings and the standard log4j logging levels.

    After applying the changes you recommended we run into a scenario where the MainFrame is dumping some of its own logging information, depending on how a setting in a GUI somewhere (I think).

    Anyway, see line 531 of MainFrame.class. This is what I ended up doing:

            else if ( mode == FilterDialog.DEBUG_MODE )
            {
                if (DEBUG)
                {
                    log.debug( "Search attempt using filter '" + dialog.getFilter() + "' "
                        + "with scope '" + dialog.getScope() + "' and a return limit of '"
                            + dialog.getLimit() + "'" );

                }
                else //it would seem we need to make a debug statement, based on a program instruction
                {    //which differs to the log4j priority.
                     //in this circumstance we simply use the old System printwriter for stdout.
                    System.out.println( "Search attempt using filter '" + dialog.getFilter() + "' "
                        + "with scope '" + dialog.getScope() + "' and a return limit of '"
                            + dialog.getLimit() + "'" );
                }
            }


   I guess Id ask the question - should the FilterDialog decide anything about logging levels?

Cheers,
Nick

> add log4j config patch
> ----------------------
>
>          Key: DIREVE-171
>          URL: http://issues.apache.org/jira/browse/DIREVE-171
>      Project: Directory Server
>         Type: Improvement
>   Components: server main
>     Versions: 0.9.1
>     Reporter: Nick Faiz
>     Assignee: Alex Karasulu
>     Priority: Trivial
>  Attachments: log4j.properties, log_patch2.txt, logging_patch.txt
>
> Please find enclosed a patch (diff file) and a log4j.properties file.
> You should create a src/etc directory for main and core and place the properties file there.
> Cheers,
> Nick

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira