incubator-empire-db-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis De Brabandere <franci...@gmail.com>
Subject Re: Log strategry with empire-db
Date Fri, 20 Aug 2010 09:20:54 GMT
On Fri, Aug 20, 2010 at 11:18 AM, Francis De Brabandere
<francisdb@gmail.com> wrote:
> On Fri, Aug 20, 2010 at 11:03 AM, exxos <hatufr@gmail.com> wrote:
>> Hi Francis,
>>
>> I use log4j too for my application. On my development view I have a single
>> properties file for the whole application.
>> And this file is given in argement of the VM as below:
>>
>> -Dlog4j.configuration=file:D:/dev/<project>/log4j.properties
>
> in fact if you put the log4j.properties somewhere on the root of the
> classpath I don't think you need this extra jvm option
>
> if you are using maven you can put it in src/main/resources for example

let me correct this, for a webapp you probably need to add this to
your WEB-INF folder

or using maven in: src/main/webapp/WEB-INF

>
>>
>> And here is the content of this "dev" file:
>>
>> log4j.rootLogger=DEBUG, R
>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>> log4j.appender.R.File=D:/dev/bdtech/logs/tomcat.log
>> log4j.appender.R.MaxFileSize=10MB
>> log4j.appender.R.MaxBackupIndex=10
>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>> log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
>
> just add this
>
> log4j.logger.org.apache.empire=OFF, R
>
> or (might be best to show at least warnings and errors)
>
> log4j.logger.org.apache.empire=WARN, R
>
> you can also filter your own logging using this technique
>
>
>>
>> So, this log4j.properties is shared implicitly with empire-db.
>> I understand that it will be better to separate each log, but here is a
>> development view, so...
>
> It is best to have all logging for your application using one logging
> framework, so you can stick with your current  setup. It is possible
> to set up log4j using the empiredb config.xml file (do you have one?)
> but you don't need that since you already set up logging yourself.
>
> Log4j supports two logging configuration formats, the .properties you
> are using and the .xml format I showed you before. You have the option
> to integrate the xml one into the empire-db config.xml, empiredb will
> then set up logging for you.
> Have a look at the basic example we provide to see how it works.
>
> But personally I would keep the logging system you have and let
> empire-db stick to its core business being sql related stuff.
>
> Cheers,
> Francis
>
>>
>> But do you have a more details about the config.xml? Where can I find more
>> information on it, than the tutorial gives?
>> Is it possible to give to empire-db another log4j.properties than the one
>> use for Tomcat and my application?
>>
>> Thank you for your help.
>>
>> Regards,
>> exxos.
>>
>>
>>
>>
>> On Fri, Aug 20, 2010 at 10:30 AM, Francis De Brabandere
>> <francisdb@gmail.com> wrote:
>>>
>>> Could you be a bit more precise? What logging system are you using?
>>> How do you set it up?
>>>
>>> You can do this in the log4j:configuration section of the config.xml
>>> if you use the empiredb configuration system. Putting
>>> org.apache.empire to level OFF should be enough.
>>>
>>> eg:
>>>
>>> <logger name="org.apache.empire" additivity="false">
>>>                        <level value="OFF"/>
>>>                        <appender-ref ref="default"/>
>>> </logger>
>>>
>>>
>>>
>>> Cheers,
>>> Francis
>>>
>>>
>>> On Fri, Aug 20, 2010 at 10:20 AM, exxos <hatufr@gmail.com> wrote:
>>> > Hi there,
>>> >
>>> > Could you please advise me on how to desactivate the internal log of
>>> > empire-db?
>>> >
>>> > For example prevent empire-db to log internaly SQL, internal exceptions
>>> > or
>>> > others functional issues.
>>> > The idea is the I prefere my business to log issues...
>>> >
>>> > Regards,
>>> > exxos.
>>> >
>>>
>>>
>>>
>>> --
>>> http://www.somatik.be
>>> Microsoft gives you windows, Linux gives you the whole house.
>>
>>
>
>
>
> --
> http://www.somatik.be
> Microsoft gives you windows, Linux gives you the whole house.
>



-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

Mime
View raw message