dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #45442
Re: Logging for Metadata sync feature
Hi Vanya,
I understand your concerns here.
However this is fine with me - this logging is not visible to users and
there won't even be produced a log file if the sync isn't enabled, so I'm
fine with you adding a new logger to Log4JLogConfigInitializer. Let me know
what you think.
best regards,
Lars
On Wed, Jun 15, 2016 at 9:37 AM, Vanya Seth <vanyas@xxxxxxxxxxxxxxxx> wrote:
> Hi Lars
>
> The metadata versioning and sync is an optional feature. It totally
> depends on the deployment strategy that we want to adopt and given that
> whether we choose to do metadata sync or not.
>
> For these reasons adding the metadata sync log as a first class citizen to
> the Log4JLogConfigInitializer does not sound like a good idea.
>
> Let me know your thoughts?
>
> Regards
> Vanya
>
> On Wed, Jun 15, 2016 at 12:41 PM, Lars Helge Øverland <lars@xxxxxxxxx>
> wrote:
>
>> 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/>
>>
>>
>
>
> --
> With Regards
> ThoughtWorks Technologies
> Hyderabad
>
> --Stay Hungry Stay Foolish!!
>
--
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