dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #45434
Re: Logging for Metadata sync feature
Hi there,
okay. It would be great if we do not introduce another way of doing
logging. The problem is that resolving the DHIS2_HOME directory is a bit
complex - the system looks for the system property dhis2.home, the env
variable DHIS2_HOME, then falls back to opt/dhis2. log4j 1 does not support
this type of custom logic directly. Perhaps log4j 2 does it, not exactly
sure, but the upgrade path is a bit tricky.
Could you instead add a new logger in Log4JLogConfigInitializer for
metadata sync? I.e.:
<DHIS2_HOME>/logs/dhis-metadata-sync.log
If you need to set a custom location for your log4j properties for testing
purposes you can already set a custom log4j.properties location, see docs
here:
http://dhis2.github.io/dhis2-docs/master/en/implementer/html/ch08s08.html
regards,
Lars
On Wed, Jun 15, 2016 at 8:13 AM, Aamer Mohammed <aamerm@xxxxxxxxxxxxxxxx>
wrote:
> Hi Lars,
>
> We are using log4j.properties file instead of 'Log4JLogConfigInitializer'
> for metadata sync logging purpose. The FILE parameter of FileAppender in
> log4j.properties needs the value of DHIS2_HOME environment variable to save
> the metadata sync log in the same folder location as that of the other
> logs. We are creating a system property specified in VM options when
> starting the DHIS server to get the value of environment variable and
> log4j.properties file can use that property.
>
> We would be mentioning this in the documentation as well. Would like to
> hear your thoughts regarding this.
>
> Thanks
> Aamer.
>
>
--
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
lars@xxxxxxxxx
http://www.dhis2.org <https://www.dhis2.org/>
Follow ups
References