Re: [ApacheDS] Review and modified version of the 'log4j.properties' file bundled in the distributions

2013-07-24 Thread Pierre-Arnaud Marcelot
On 24 juil. 2013, at 15:54, Pierre-Arnaud Marcelot  wrote:

> 
> On 24 juil. 2013, at 15:50, Kiran Ayyagari  wrote:
> 
>> no objection as long as this change is part of the installer specific files, 
>> I want the
>> console appender to be retained in service module which is used for most of 
>> the testing
>> during development 
> 
> Exactly. It won't change the development config in the build.
> This is only intended to be used with the distributions.

Just a small addition.
There is a kind of distribution that will still require the console appender, 
it's the Archive (zip & tar.gz) distribution.
In this distrib, ApacheDS is run from the command line in an interactive mode 
(meaning that CTL+C kills the process)
So I think it makes sense to still keep the log directed to the console (in 
addition to the file).

> Regards,
> Pierre-Arnaud



Re: [ApacheDS] Review and modified version of the 'log4j.properties' file bundled in the distributions

2013-07-24 Thread Pierre-Arnaud Marcelot

On 24 juil. 2013, at 15:50, Kiran Ayyagari  wrote:

> no objection as long as this change is part of the installer specific files, 
> I want the
> console appender to be retained in service module which is used for most of 
> the testing
> during development 

Exactly. It won't change the development config in the build.
This is only intended to be used with the distributions.

Regards,
Pierre-Arnaud

Re: [ApacheDS] Review and modified version of the 'log4j.properties' file bundled in the distributions

2013-07-24 Thread Kiran Ayyagari
On Wed, Jul 24, 2013 at 6:42 PM, Pierre-Arnaud Marcelot 
wrote:

> Hi,
>
> A recent discussion on IRC and the mailing list, followed by the creation
> of DIRSERVER-1871 [1] made me look at the way logs could be activated and
> specifically the 'log4j.properties' file we bundle in the distributions.
>
> Here's the content of the current version of this file:
>
>
> #
> #Licensed to the Apache Software Foundation (ASF) under one or more
> #contributor license agreements.  See the NOTICE file distributed with
> #this work for additional information regarding copyright ownership.
> #The ASF licenses this file to You under the Apache License, Version
> 2.0
> #(the "License"); you may not use this file except in compliance with
> #the License.  You may obtain a copy of the License at
> #
> #   http://www.apache.org/licenses/LICENSE-2.0
> #
> #Unless required by applicable law or agreed to in writing, software
> #distributed under the License is distributed on an "AS IS" BASIS,
> #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> #See the License for the specific language governing permissions and
> #limitations under the License.
>
> #
> log4j.rootCategory=WARN, R, stdout
>
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.File=${apacheds.log.dir}/apacheds.log
>
> log4j.appender.R.MaxFileSize=1024KB
> # Keep some backup files
> log4j.appender.R.MaxBackupIndex=5
>
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
>
> log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] -
> %m%n
>
> # with these we'll not get innundated when switching to DEBUG
> log4j.logger.jdbm.recman.BaseRecordManager=FATAL
> log4j.logger.org.apache.directory.server.OPERATION_LOG=FATAL
> log4j.logger.org.apache.directory.server.OPERATION_TIME=FATAL
> log4j.logger.org.apache.directory.api.CODEC_LOG=FATAL
> log4j.logger.org.apache.directory.server.ACI_LOG=FATAL
> log4j.logger.org.apache.directory.server.PROVIDER_LOG=FATAL
> log4j.logger.org.apache.directory.server.CONSUMER_LOG=FATAL
> log4j.logger.org.apache.directory.CURSOR_LOG=FATAL
> log4j.logger.org.apache.directory.api=FATAL
> log4j.logger.org.apache.directory.server=FATAL
> log4j.logger.net.sf.ehcache=FATAL
> log4j.logger.org.apache.mina=FATAL
>
>
> A few comments on it.
>
> First, we have two appenders ('R' & 'stdout').
> I don't really see the utility of having these two. The
> RollingFileAppender should be enough.
>
> What happens now with the ConsoleAppender is that any log we can find in
> the 'apacheds.log' is then duplicated in the 'wrapper.log' file, mandatory
> log file for the Tanuki wrapper whichs logs succesful or failed launched
> and termination attempts of the server.
>
> Personally, I would get rid of the ConsoleAppender (unfortunately, we will
> have two different log files but there's not that can be done about that).
>
> no objection as long as this change is part of the installer specific
files, I want the
console appender to be retained in service module which is used for most of
the testing
during development

> I also took the liberty to modify the RollingFileAppender settings to
> something more useful than the current values.
> I increased 'MaxFileSize' to '100MB' and decreased 'MaxBackupIndex' to '3'.
> So, at most that would be 300 MB dedicated to logs.
> It looks enough for me.
>
> Last but not least, I fixed what was causing most of our log issues.
> At the end of the file, there are a lot of specific loggers all set to
> FATAL.
> Two are especially interesting, 'org.apache.directory.api' &
> 'org.apache.directory.server'. Setting these ones to 'FATAL' means that we
> will only log severe errors for all classes of the LDAP API and ApacheDS.
> But it also means that the setting of the root logger at the beginning of
> the file has absolutely no effect, hence the problems we've been having
> with log activations.
>
> I propose that we keep these definitions, which are very useful when we
> need to debug things in the server, but that they should be set with a
> 'DEBUG'  log level and be deactivated by default.
>
> In the end, an updated version of the file looks like this:
>
>
> #
> #Licensed to the Apache Software Foundation (ASF) under one or more
> #contributor license agreements.  See the NOTICE file distributed with
> #this work for additional information regarding copyright ownership.
> #The ASF licenses this file to You under the Apache License, Version
> 2.0
> #(the "License"); you may not use this fi

Re: [ApacheDS] Review and modified version of the 'log4j.properties' file bundled in the distributions

2013-07-24 Thread Emmanuel Lécharny
Le 7/24/13 3:12 PM, Pierre-Arnaud Marcelot a écrit :
> Hi,
>
> A recent discussion on IRC and the mailing list, followed by the creation of 
> DIRSERVER-1871 [1] made me look at the way logs could be activated and 
> specifically the 'log4j.properties' file we bundle in the distributions.
>
> Here's the content of the current version of this file:
>> #
>> #Licensed to the Apache Software Foundation (ASF) under one or more
>> #contributor license agreements.  See the NOTICE file distributed with
>> #this work for additional information regarding copyright ownership.
>> #The ASF licenses this file to You under the Apache License, Version 2.0
>> #(the "License"); you may not use this file except in compliance with
>> #the License.  You may obtain a copy of the License at
>> #
>> #   http://www.apache.org/licenses/LICENSE-2.0
>> #
>> #Unless required by applicable law or agreed to in writing, software
>> #distributed under the License is distributed on an "AS IS" BASIS,
>> #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>> #See the License for the specific language governing permissions and
>> #limitations under the License.
>> #
>> log4j.rootCategory=WARN, R, stdout
>>
>> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>>
>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>> log4j.appender.R.File=${apacheds.log.dir}/apacheds.log
>>
>> log4j.appender.R.MaxFileSize=1024KB
>> # Keep some backup files
>> log4j.appender.R.MaxBackupIndex=5
>>
>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>> log4j.appender.R.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
>>
>> log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
>>
>> # with these we'll not get innundated when switching to DEBUG
>> log4j.logger.jdbm.recman.BaseRecordManager=FATAL
>> log4j.logger.org.apache.directory.server.OPERATION_LOG=FATAL
>> log4j.logger.org.apache.directory.server.OPERATION_TIME=FATAL
>> log4j.logger.org.apache.directory.api.CODEC_LOG=FATAL
>> log4j.logger.org.apache.directory.server.ACI_LOG=FATAL
>> log4j.logger.org.apache.directory.server.PROVIDER_LOG=FATAL
>> log4j.logger.org.apache.directory.server.CONSUMER_LOG=FATAL
>> log4j.logger.org.apache.directory.CURSOR_LOG=FATAL
>> log4j.logger.org.apache.directory.api=FATAL
>> log4j.logger.org.apache.directory.server=FATAL
>> log4j.logger.net.sf.ehcache=FATAL
>> log4j.logger.org.apache.mina=FATAL
> A few comments on it.
>
> First, we have two appenders ('R' & 'stdout').
> I don't really see the utility of having these two. The RollingFileAppender 
> should be enough.
>
> What happens now with the ConsoleAppender is that any log we can find in the 
> 'apacheds.log' is then duplicated in the 'wrapper.log' file, mandatory log 
> file for the Tanuki wrapper whichs logs succesful or failed launched and 
> termination attempts of the server.
>
> Personally, I would get rid of the ConsoleAppender (unfortunately, we will 
> have two different log files but there's not that can be done about that).

+1
>
> I also took the liberty to modify the RollingFileAppender settings to 
> something more useful than the current values.
> I increased 'MaxFileSize' to '100MB' and decreased 'MaxBackupIndex' to '3'.
> So, at most that would be 300 MB dedicated to logs.
> It looks enough for me.

+1
>
> Last but not least, I fixed what was causing most of our log issues.
> At the end of the file, there are a lot of specific loggers all set to FATAL.
> Two are especially interesting, 'org.apache.directory.api' & 
> 'org.apache.directory.server'. Setting these ones to 'FATAL' means that we 
> will only log severe errors for all classes of the LDAP API and ApacheDS.
> But it also means that the setting of the root logger at the beginning of the 
> file has absolutely no effect, hence the problems we've been having with log 
> activations.
>
> I propose that we keep these definitions, which are very useful when we need 
> to debug things in the server, but that they should be set with a 'DEBUG'  
> log level and be deactivated by default.

Fine with me.
>
> In the end, an updated version of the file looks like this:
>> #
>> #Licensed to the Apache Software Foundation (ASF) under one or more
>> #contributor license agreements.  See the NOTICE file distributed with
>> #this work for additional information regarding copyright ownership.
>> #The ASF licenses this file to You under the Apache License, Version 2.0
>> #(the "License"); you may not use this file except in compliance with
>> #the License.  You may obtain a copy of the License at
>> #
>> #   http://www.apache.org/licenses/LICENSE

[ApacheDS] Review and modified version of the 'log4j.properties' file bundled in the distributions

2013-07-24 Thread Pierre-Arnaud Marcelot
Hi,

A recent discussion on IRC and the mailing list, followed by the creation of 
DIRSERVER-1871 [1] made me look at the way logs could be activated and 
specifically the 'log4j.properties' file we bundle in the distributions.

Here's the content of the current version of this file:
> #
> #Licensed to the Apache Software Foundation (ASF) under one or more
> #contributor license agreements.  See the NOTICE file distributed with
> #this work for additional information regarding copyright ownership.
> #The ASF licenses this file to You under the Apache License, Version 2.0
> #(the "License"); you may not use this file except in compliance with
> #the License.  You may obtain a copy of the License at
> #
> #   http://www.apache.org/licenses/LICENSE-2.0
> #
> #Unless required by applicable law or agreed to in writing, software
> #distributed under the License is distributed on an "AS IS" BASIS,
> #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> #See the License for the specific language governing permissions and
> #limitations under the License.
> #
> log4j.rootCategory=WARN, R, stdout
> 
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> 
> log4j.appender.R=org.apache.log4j.RollingFileAppender
> log4j.appender.R.File=${apacheds.log.dir}/apacheds.log
> 
> log4j.appender.R.MaxFileSize=1024KB
> # Keep some backup files
> log4j.appender.R.MaxBackupIndex=5
> 
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
> 
> log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
> 
> # with these we'll not get innundated when switching to DEBUG
> log4j.logger.jdbm.recman.BaseRecordManager=FATAL
> log4j.logger.org.apache.directory.server.OPERATION_LOG=FATAL
> log4j.logger.org.apache.directory.server.OPERATION_TIME=FATAL
> log4j.logger.org.apache.directory.api.CODEC_LOG=FATAL
> log4j.logger.org.apache.directory.server.ACI_LOG=FATAL
> log4j.logger.org.apache.directory.server.PROVIDER_LOG=FATAL
> log4j.logger.org.apache.directory.server.CONSUMER_LOG=FATAL
> log4j.logger.org.apache.directory.CURSOR_LOG=FATAL
> log4j.logger.org.apache.directory.api=FATAL
> log4j.logger.org.apache.directory.server=FATAL
> log4j.logger.net.sf.ehcache=FATAL
> log4j.logger.org.apache.mina=FATAL

A few comments on it.

First, we have two appenders ('R' & 'stdout').
I don't really see the utility of having these two. The RollingFileAppender 
should be enough.

What happens now with the ConsoleAppender is that any log we can find in the 
'apacheds.log' is then duplicated in the 'wrapper.log' file, mandatory log file 
for the Tanuki wrapper whichs logs succesful or failed launched and termination 
attempts of the server.

Personally, I would get rid of the ConsoleAppender (unfortunately, we will have 
two different log files but there's not that can be done about that).

I also took the liberty to modify the RollingFileAppender settings to something 
more useful than the current values.
I increased 'MaxFileSize' to '100MB' and decreased 'MaxBackupIndex' to '3'.
So, at most that would be 300 MB dedicated to logs.
It looks enough for me.

Last but not least, I fixed what was causing most of our log issues.
At the end of the file, there are a lot of specific loggers all set to FATAL.
Two are especially interesting, 'org.apache.directory.api' & 
'org.apache.directory.server'. Setting these ones to 'FATAL' means that we will 
only log severe errors for all classes of the LDAP API and ApacheDS.
But it also means that the setting of the root logger at the beginning of the 
file has absolutely no effect, hence the problems we've been having with log 
activations.

I propose that we keep these definitions, which are very useful when we need to 
debug things in the server, but that they should be set with a 'DEBUG'  log 
level and be deactivated by default.

In the end, an updated version of the file looks like this:
> #
> #Licensed to the Apache Software Foundation (ASF) under one or more
> #contributor license agreements.  See the NOTICE file distributed with
> #this work for additional information regarding copyright ownership.
> #The ASF licenses this file to You under the Apache License, Version 2.0
> #(the "License"); you may not use this file except in compliance with
> #the License.  You may obtain a copy of the License at
> #
> #   http://www.apache.org/licenses/LICENSE-2.0
> #
> #Unless required by applicable law or agreed to in writing, software
> #distributed under the License is distributed on an "AS IS" BASIS,
> #WITHOUT WARRANTIES OR CONDITIONS