You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Jörg Hoh <jh...@googlemail.com> on 2014/11/27 23:07:35 UTC

Logging relative to a specific path

Hi,

I am just evaluating if it's possible to specifiy a directory, which is
used to resolve all relative log file against. The documentation states, it
always resolves against the "sling.home" directory, but can I change this?
I haven't found any pointer neither in the source nor on the documentation
page.


kind regards && thanks,
Jörg

Re: Logging relative to a specific path

Posted by Jörg Hoh <jh...@googlemail.com>.
I raised SLING-4225 for it and also attached the patch.

Thanks,
Jörg

2014-11-29 16:39 GMT+01:00 Chetan Mehrotra <ch...@gmail.com>:

> > sling.log.root = ${sling.home}
>
> +1. This would also allows using Sling Logging in non Sling Container
> easily
> Chetan Mehrotra
>
>
> On Fri, Nov 28, 2014 at 7:33 PM, Felix Meschberger <fm...@adobe.com>
> wrote:
> > Hi
> >
> > How about a sling.log.root property, which we define as
> >
> >> sling.log.root = ${sling.home}
> >
> > in the sling.properties ?
> >
> > Regards
> > Felix
> >
> >> Am 28.11.2014 um 11:16 schrieb Jörg Hoh <jh...@googlemail.com>:
> >>
> >> Hi Felix,
> >>
> >> I would like to stick to OSGI-based configuration and rather no use any
> >> logback configuration file. I will then try to come up with a patch.
> Thanks
> >> for your help.
> >>
> >> regards,
> >> Jörg
> >>
> >> 2014-11-28 7:50 GMT+01:00 Felix Meschberger <fm...@adobe.com>:
> >>
> >>> Hi
> >>>
> >>> It used to be that the Sling SLF4J implementation had the code to
> resolve
> >>> relative paths against sling.home and that was not configurable.
> >>>
> >>> In the meantime we switched over to embedding Logback instead. Looks
> like
> >>> this is still part of the logging configuration. See LogConfigManager
> which
> >>> uses sling.home as the root directory handed over to the
> >>> LogWriterManagedServiceFactory for OSGi-based logging configuration.
> >>>
> >>> On the other hand Logback configuration files are supported as well
> these
> >>> days and I am not really sure how relative paths are handled there.
> >>>
> >>> Regards
> >>> Felix
> >>>
> >>>> Am 27.11.2014 um 23:07 schrieb Jörg Hoh <jh...@googlemail.com>:
> >>>>
> >>>> Hi,
> >>>>
> >>>> I am just evaluating if it's possible to specifiy a directory, which
> is
> >>>> used to resolve all relative log file against. The documentation
> states,
> >>> it
> >>>> always resolves against the "sling.home" directory, but can I change
> >>> this?
> >>>> I haven't found any pointer neither in the source nor on the
> >>> documentation
> >>>> page.
> >>>>
> >>>>
> >>>> kind regards && thanks,
> >>>> Jörg
> >>>
> >>>
> >>
> >>
> >> --
> >> Cheers,
> >> Jörg Hoh,
> >>
> >> http://cqdump.wordpress.com
> >> Twitter: @joerghoh
> >
>



-- 
Cheers,
Jörg Hoh,

http://cqdump.wordpress.com
Twitter: @joerghoh

Re: Logging relative to a specific path

Posted by Chetan Mehrotra <ch...@gmail.com>.
> sling.log.root = ${sling.home}

+1. This would also allows using Sling Logging in non Sling Container easily
Chetan Mehrotra


On Fri, Nov 28, 2014 at 7:33 PM, Felix Meschberger <fm...@adobe.com> wrote:
> Hi
>
> How about a sling.log.root property, which we define as
>
>> sling.log.root = ${sling.home}
>
> in the sling.properties ?
>
> Regards
> Felix
>
>> Am 28.11.2014 um 11:16 schrieb Jörg Hoh <jh...@googlemail.com>:
>>
>> Hi Felix,
>>
>> I would like to stick to OSGI-based configuration and rather no use any
>> logback configuration file. I will then try to come up with a patch. Thanks
>> for your help.
>>
>> regards,
>> Jörg
>>
>> 2014-11-28 7:50 GMT+01:00 Felix Meschberger <fm...@adobe.com>:
>>
>>> Hi
>>>
>>> It used to be that the Sling SLF4J implementation had the code to resolve
>>> relative paths against sling.home and that was not configurable.
>>>
>>> In the meantime we switched over to embedding Logback instead. Looks like
>>> this is still part of the logging configuration. See LogConfigManager which
>>> uses sling.home as the root directory handed over to the
>>> LogWriterManagedServiceFactory for OSGi-based logging configuration.
>>>
>>> On the other hand Logback configuration files are supported as well these
>>> days and I am not really sure how relative paths are handled there.
>>>
>>> Regards
>>> Felix
>>>
>>>> Am 27.11.2014 um 23:07 schrieb Jörg Hoh <jh...@googlemail.com>:
>>>>
>>>> Hi,
>>>>
>>>> I am just evaluating if it's possible to specifiy a directory, which is
>>>> used to resolve all relative log file against. The documentation states,
>>> it
>>>> always resolves against the "sling.home" directory, but can I change
>>> this?
>>>> I haven't found any pointer neither in the source nor on the
>>> documentation
>>>> page.
>>>>
>>>>
>>>> kind regards && thanks,
>>>> Jörg
>>>
>>>
>>
>>
>> --
>> Cheers,
>> Jörg Hoh,
>>
>> http://cqdump.wordpress.com
>> Twitter: @joerghoh
>

Re: Logging relative to a specific path

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

How about a sling.log.root property, which we define as

> sling.log.root = ${sling.home}

in the sling.properties ?

Regards
Felix

> Am 28.11.2014 um 11:16 schrieb Jörg Hoh <jh...@googlemail.com>:
> 
> Hi Felix,
> 
> I would like to stick to OSGI-based configuration and rather no use any
> logback configuration file. I will then try to come up with a patch. Thanks
> for your help.
> 
> regards,
> Jörg
> 
> 2014-11-28 7:50 GMT+01:00 Felix Meschberger <fm...@adobe.com>:
> 
>> Hi
>> 
>> It used to be that the Sling SLF4J implementation had the code to resolve
>> relative paths against sling.home and that was not configurable.
>> 
>> In the meantime we switched over to embedding Logback instead. Looks like
>> this is still part of the logging configuration. See LogConfigManager which
>> uses sling.home as the root directory handed over to the
>> LogWriterManagedServiceFactory for OSGi-based logging configuration.
>> 
>> On the other hand Logback configuration files are supported as well these
>> days and I am not really sure how relative paths are handled there.
>> 
>> Regards
>> Felix
>> 
>>> Am 27.11.2014 um 23:07 schrieb Jörg Hoh <jh...@googlemail.com>:
>>> 
>>> Hi,
>>> 
>>> I am just evaluating if it's possible to specifiy a directory, which is
>>> used to resolve all relative log file against. The documentation states,
>> it
>>> always resolves against the "sling.home" directory, but can I change
>> this?
>>> I haven't found any pointer neither in the source nor on the
>> documentation
>>> page.
>>> 
>>> 
>>> kind regards && thanks,
>>> Jörg
>> 
>> 
> 
> 
> -- 
> Cheers,
> Jörg Hoh,
> 
> http://cqdump.wordpress.com
> Twitter: @joerghoh


Re: Logging relative to a specific path

Posted by Jörg Hoh <jh...@googlemail.com>.
Hi Felix,

I would like to stick to OSGI-based configuration and rather no use any
logback configuration file. I will then try to come up with a patch. Thanks
for your help.

regards,
Jörg

2014-11-28 7:50 GMT+01:00 Felix Meschberger <fm...@adobe.com>:

> Hi
>
> It used to be that the Sling SLF4J implementation had the code to resolve
> relative paths against sling.home and that was not configurable.
>
> In the meantime we switched over to embedding Logback instead. Looks like
> this is still part of the logging configuration. See LogConfigManager which
> uses sling.home as the root directory handed over to the
> LogWriterManagedServiceFactory for OSGi-based logging configuration.
>
> On the other hand Logback configuration files are supported as well these
> days and I am not really sure how relative paths are handled there.
>
> Regards
> Felix
>
> > Am 27.11.2014 um 23:07 schrieb Jörg Hoh <jh...@googlemail.com>:
> >
> > Hi,
> >
> > I am just evaluating if it's possible to specifiy a directory, which is
> > used to resolve all relative log file against. The documentation states,
> it
> > always resolves against the "sling.home" directory, but can I change
> this?
> > I haven't found any pointer neither in the source nor on the
> documentation
> > page.
> >
> >
> > kind regards && thanks,
> > Jörg
>
>


-- 
Cheers,
Jörg Hoh,

http://cqdump.wordpress.com
Twitter: @joerghoh

Re: Logging relative to a specific path

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

It used to be that the Sling SLF4J implementation had the code to resolve relative paths against sling.home and that was not configurable.

In the meantime we switched over to embedding Logback instead. Looks like this is still part of the logging configuration. See LogConfigManager which uses sling.home as the root directory handed over to the LogWriterManagedServiceFactory for OSGi-based logging configuration.

On the other hand Logback configuration files are supported as well these days and I am not really sure how relative paths are handled there.

Regards
Felix

> Am 27.11.2014 um 23:07 schrieb Jörg Hoh <jh...@googlemail.com>:
> 
> Hi,
> 
> I am just evaluating if it's possible to specifiy a directory, which is
> used to resolve all relative log file against. The documentation states, it
> always resolves against the "sling.home" directory, but can I change this?
> I haven't found any pointer neither in the source nor on the documentation
> page.
> 
> 
> kind regards && thanks,
> Jörg