← Back to team overview

dhis2-users team mailing list archive

Re: Tomcat Logging Levels / DHIS2

 

Hi Jason,

we do use log4j for logging so you need to use the log4j configuration
syntax to modify the behavior.

You can do this to raise the log level for the spring authentication, try
something like this in your log4j.properties:


springframework.security.web.authentication = ERROR




Lars




On Thu, Mar 10, 2016 at 3:29 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx> wrote:

> Not daft (well not completely daft).  You cannot change the default
> logging configuration.  It is set programmatically in java.
>
> Your option is to create a custom log4j configuration as per the
> documentation.
>
> In production you might want to do this anyway, rather than rely on the
> baked in configuration.  Some time ago I produced a log4j configuration
> file which mimiced the behaviour of the hard coded configuration but I lost
> it - I know, I should have committed it somewhere but I didn't.  Now I will
> (eventually) have to do it again.
>
> (An alternative future approach might be to allow some of these things to
> be fine tuned in the settings through the ui but this is currently not
> possible)
>
> On 10 March 2016 at 14:21, Jason Phillips <jason@xxxxxxxx> wrote:
>
>> Hi Lars,
>>
>>
>>
>> Yep – and unless I’ve dropped a few IQ points, I can’t see where it tell
>> you how to adjust the logging levels.
>>
>> It explains the extra logging I referred to, but doesn’t tell me how to
>> change anything in the default logging, unless I am being daft?
>>
>> I don’t want to use log4j, or anything else; I just want to stop the
>> thing from logging authentications…
>>
>>
>>
>> Am I being daft?
>>
>>
>>
>> Best,
>>
>> Jason.
>>
>>
>>
>>
>>
>> *From:* Lars Helge Øverland [mailto:lars@xxxxxxxxx]
>> *Sent:* Thursday, 10 March 2016 2:58 PM
>> *To:* Jason Phillips
>> *Cc:* DHIS 2 Users list
>> *Subject:* Re: [Dhis2-users] Tomcat Logging Levels / DHIS2
>>
>>
>>
>> Hi Jason,
>>
>>
>>
>> did you look at this section in the docs?
>>
>>
>>
>> http://dhis2.github.io/dhis2-docs/master/en/implementer/html/ch08s08.html
>>
>>
>>
>> regards,
>>
>>
>>
>> Lars
>>
>>
>>
>>
>>
>> On Thu, Mar 10, 2016 at 1:25 PM, Jason Phillips <jason@xxxxxxxx> wrote:
>>
>> Hi all,
>>
>>
>>
>> Can anyone provide me with details of how to make changes to DHIS2 Tomcat
>> logging levels?
>>
>>
>>
>> I have tried editing logging.properties in [BASE]/conf, and turning off
>> logging (and various other attempts at different levels, such as SEVERE,
>> WARNING, etc) using the folling settings:
>>
>>
>>
>> ------------------------
>>
>> 1catalina.org.apache.juli.FileHandler.level = OFF
>>
>> 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
>>
>> 1catalina.org.apache.juli.FileHandler.prefix = catalina.
>>
>>
>>
>> 2localhost.org.apache.juli.FileHandler.level = OFF
>>
>> 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
>>
>> 2localhost.org.apache.juli.FileHandler.prefix = localhost.
>>
>>
>>
>> java.util.logging.ConsoleHandler.level = OFF
>>
>> java.util.logging.ConsoleHandler.formatter =
>> java.util.logging.SimpleFormatter
>>
>>
>>
>> …
>>
>>
>>
>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = OFF
>>
>> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
>> 2localhost.org.apache.juli.FileHandler
>>
>>
>>
>> ------------------------
>>
>> And still no joy – DHIS2 logs away, regardless.  I have set the levels to
>> alternating variants of SEVERE, FINE, FINEST, WARNING and others to no
>> discernible effect.
>>
>> Any info would be most appreciated.
>>
>>
>>
>> Also, while on the subject, I notice that logging duplication appears to
>> be happening in the [BASE]/conf/logs folder, albeit separated into
>> different files based on function/origin.
>>
>> Are those logs affected by the same settings/properties, and how does one
>> manipulate their levels, in addition to or separately from, the standard
>> catalina.out?
>>
>>
>>
>> Kind Regards,
>>
>> *Jason Phillips*
>>
>> [image: hisp]
>> *Information Systems / Infrastructure*
>>
>> *Health Information Systems Program____________________________________*
>>
>> eMail:               jason@xxxxxxxx
>> Landline:          +27 21 712 0170
>> Mobile:             +27 72 973 7250
>> Skype:             jason.n.phillips
>>
>> This message and any attachments are subject to a disclaimer published at
>> http://www.hisp.org/policies.html#comms_disclaimer.  Please read the
>> disclaimer before opening any attachment or taking any other action in
>> terms of this electronic transmission.  If you cannot access the
>> disclaimer, kindly send an email to disclaimer@xxxxxxxx and a copy will
>> be provided to you. By replying to this e-mail or opening any attachment
>> you agree to be bound by the provisions of the disclaimer.
>>
>>
>>
>>
>>
>> *This message and any attachments are subject to a disclaimer published
>> at http://www.hisp.org/policies.html#comms_disclaimer
>> <http://www.hisp.org/policies.html#comms_disclaimer>.  Please read the
>> disclaimer before opening any attachment or taking any other action in
>> terms of this electronic transmission.  If you cannot access the
>> disclaimer, kindly send an email to disclaimer@xxxxxxxx
>> <disclaimer@xxxxxxxx> and a copy will be provided to you. By replying to
>> this e-mail or opening any attachment you agree to be bound by the
>> provisions of the disclaimer.*
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>>
>>
>>
>> --
>>
>> Lars Helge Øverland
>>
>> Lead developer, DHIS 2
>>
>> University of Oslo
>>
>> Skype: larshelgeoverland
>>
>> http://www.dhis2.org <https://www.dhis2.org/>
>>
>>
>>
>> *This message and any attachments are subject to a disclaimer published
>> at http://www.hisp.org/policies.html#comms_disclaimer
>> <http://www.hisp.org/policies.html#comms_disclaimer>.  Please read the
>> disclaimer before opening any attachment or taking any other action in
>> terms of this electronic transmission.  If you cannot access the
>> disclaimer, kindly send an email to disclaimer@xxxxxxxx
>> <disclaimer@xxxxxxxx> and a copy will be provided to you. By replying to
>> this e-mail or opening any attachment you agree to be bound by the
>> provisions of the disclaimer.*
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org <https://www.dhis2.org/>

PNG image


Follow ups

References