Log4j and Java 9 JPMS support

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Log4j and Java 9 JPMS support

Alex Sviridov
Hi all

Could anyone say if log4j 1/2 can create separate log file for every JPMS module?

For example I have application that consists of three named modules moduleA, moduleB,
moduleC. And I want to have three log files moduleA.log, moduleB.log, moduleC.log.

If such feature is not supported, can anyone say when approximately it will be
implemented.

Best regards, Alex
Reply | Threaded
Open this post in threaded view
|

Re: Log4j and Java 9 JPMS support

Ralph Goers
Right now LoggerContexts are organized around ClassLoaders. We haven’t even talked about creating a ModuleContextSelector. If you want to help contribute towards that it would be welcome.

Ralph

> On Sep 18, 2017, at 1:18 AM, Alex Sviridov <[hidden email]> wrote:
>
> Hi all
>
> Could anyone say if log4j 1/2 can create separate log file for every JPMS module?
>
> For example I have application that consists of three named modules moduleA, moduleB,
> moduleC. And I want to have three log files moduleA.log, moduleB.log, moduleC.log.
>
> If such feature is not supported, can anyone say when approximately it will be
> implemented.
>
> Best regards, Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re[2]: Log4j and Java 9 JPMS support

Alex Sviridov
The problem is that I know nothing about log4j architecture. I am just a user.

Is it so difficult task? If log4j has access to class it can access and
its module and after that use sift appender by module name.
Application module has name, automatic module has name,
all unnamed module goes to one file.

Another question - has anyone tried log4j as named module on java 9?

Best regards, Alex


>Понедельник, 18 сентября 2017, 16:44 +03:00 от Ralph Goers <[hidden email]>:
>
>Right now LoggerContexts are organized around ClassLoaders. We haven’t even talked about creating a ModuleContextSelector. If you want to help contribute towards that it would be welcome.
>
>Ralph
>
>> On Sep 18, 2017, at 1:18 AM, Alex Sviridov < [hidden email] > wrote:
>>
>> Hi all
>>
>> Could anyone say if log4j 1/2 can create separate log file for every JPMS module?
>>
>> For example I have application that consists of three named modules moduleA, moduleB,
>> moduleC. And I want to have three log files moduleA.log, moduleB.log, moduleC.log.
>>
>> If such feature is not supported, can anyone say when approximately it will be
>> implemented.
>>
>> Best regards, Alex
>
>


--
Alex Sviridov
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: Log4j and Java 9 JPMS support

Matt Sicker
Take a look at the ClassLoaderContextSelector class along with the JPMS
API. It should be relatively self explanatory. Feel free to follow up with
questions on the dev list if you want as well.

On 18 September 2017 at 09:40, Alex Sviridov <[hidden email]>
wrote:

> The problem is that I know nothing about log4j architecture. I am just a
> user.
>
> Is it so difficult task? If log4j has access to class it can access and
> its module and after that use sift appender by module name.
> Application module has name, automatic module has name,
> all unnamed module goes to one file.
>
> Another question - has anyone tried log4j as named module on java 9?
>
> Best regards, Alex
>
>
> >Понедельник, 18 сентября 2017, 16:44 +03:00 от Ralph Goers <
> [hidden email]>:
> >
> >Right now LoggerContexts are organized around ClassLoaders. We haven’t
> even talked about creating a ModuleContextSelector. If you want to help
> contribute towards that it would be welcome.
> >
> >Ralph
> >
> >> On Sep 18, 2017, at 1:18 AM, Alex Sviridov < [hidden email]
> > wrote:
> >>
> >> Hi all
> >>
> >> Could anyone say if log4j 1/2 can create separate log file for every
> JPMS module?
> >>
> >> For example I have application that consists of three named modules
> moduleA, moduleB,
> >> moduleC. And I want to have three log files moduleA.log, moduleB.log,
> moduleC.log.
> >>
> >> If such feature is not supported, can anyone say when approximately it
> will be
> >> implemented.
> >>
> >> Best regards, Alex
> >
> >
>
>
> --
> Alex Sviridov
>



--
Matt Sicker <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Log4j and Java 9 JPMS support

Ralph Goers
Actually, you are asking for a log file per module. That shouldn’t require a new ContextSelector. That would only be required if you wanted to have a separate configuration for each module.

Right now Log4j doesn’t do anything to identify what module a class is located in. That would be required to use the RoutingAppender.

Log4j is not yet modularized. The module system was up in the air until about 6 weeks ago so we put off work on that.

Ralph

> On Sep 18, 2017, at 7:57 AM, Matt Sicker <[hidden email]> wrote:
>
> Take a look at the ClassLoaderContextSelector class along with the JPMS
> API. It should be relatively self explanatory. Feel free to follow up with
> questions on the dev list if you want as well.
>
> On 18 September 2017 at 09:40, Alex Sviridov <[hidden email]>
> wrote:
>
>> The problem is that I know nothing about log4j architecture. I am just a
>> user.
>>
>> Is it so difficult task? If log4j has access to class it can access and
>> its module and after that use sift appender by module name.
>> Application module has name, automatic module has name,
>> all unnamed module goes to one file.
>>
>> Another question - has anyone tried log4j as named module on java 9?
>>
>> Best regards, Alex
>>
>>
>>> Понедельник, 18 сентября 2017, 16:44 +03:00 от Ralph Goers <
>> [hidden email]>:
>>>
>>> Right now LoggerContexts are organized around ClassLoaders. We haven’t
>> even talked about creating a ModuleContextSelector. If you want to help
>> contribute towards that it would be welcome.
>>>
>>> Ralph
>>>
>>>> On Sep 18, 2017, at 1:18 AM, Alex Sviridov < [hidden email]
>>> wrote:
>>>>
>>>> Hi all
>>>>
>>>> Could anyone say if log4j 1/2 can create separate log file for every
>> JPMS module?
>>>>
>>>> For example I have application that consists of three named modules
>> moduleA, moduleB,
>>>> moduleC. And I want to have three log files moduleA.log, moduleB.log,
>> moduleC.log.
>>>>
>>>> If such feature is not supported, can anyone say when approximately it
>> will be
>>>> implemented.
>>>>
>>>> Best regards, Alex
>>>
>>>
>>
>>
>> --
>> Alex Sviridov
>>
>
>
>
> --
> Matt Sicker <[hidden email]>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re[2]: Log4j and Java 9 JPMS support

Alex Sviridov
Java 9 is almost here. Maybe it is time to start moving Log4j to JPMS?

Best regards, Alex


>Понедельник, 18 сентября 2017, 18:51 +03:00 от Ralph Goers <[hidden email]>:
>
>Actually, you are asking for a log file per module. That shouldn’t require a new ContextSelector. That would only be required if you wanted to have a separate configuration for each module.
>
>Right now Log4j doesn’t do anything to identify what module a class is located in. That would be required to use the RoutingAppender.
>
>Log4j is not yet modularized. The module system was up in the air until about 6 weeks ago so we put off work on that.
>
>Ralph
>
>> On Sep 18, 2017, at 7:57 AM, Matt Sicker < [hidden email] > wrote:
>>
>> Take a look at the ClassLoaderContextSelector class along with the JPMS
>> API. It should be relatively self explanatory. Feel free to follow up with
>> questions on the dev list if you want as well.
>>
>> On 18 September 2017 at 09:40, Alex Sviridov < [hidden email] >
>> wrote:
>>
>>> The problem is that I know nothing about log4j architecture. I am just a
>>> user.
>>>
>>> Is it so difficult task? If log4j has access to class it can access and
>>> its module and after that use sift appender by module name.
>>> Application module has name, automatic module has name,
>>> all unnamed module goes to one file.
>>>
>>> Another question - has anyone tried log4j as named module on java 9?
>>>
>>> Best regards, Alex
>>>
>>>
>>>> Понедельник, 18 сентября 2017, 16:44 +03:00 от Ralph Goers <
>>>  [hidden email] >:
>>>>
>>>> Right now LoggerContexts are organized around ClassLoaders. We haven’t
>>> even talked about creating a ModuleContextSelector. If you want to help
>>> contribute towards that it would be welcome.
>>>>
>>>> Ralph
>>>>
>>>>> On Sep 18, 2017, at 1:18 AM, Alex Sviridov <  [hidden email]
>>>> wrote:
>>>>>
>>>>> Hi all
>>>>>
>>>>> Could anyone say if log4j 1/2 can create separate log file for every
>>> JPMS module?
>>>>>
>>>>> For example I have application that consists of three named modules
>>> moduleA, moduleB,
>>>>> moduleC. And I want to have three log files moduleA.log, moduleB.log,
>>> moduleC.log.
>>>>>
>>>>> If such feature is not supported, can anyone say when approximately it
>>> will be
>>>>> implemented.
>>>>>
>>>>> Best regards, Alex
>>>>
>>>>
>>>
>>>
>>> --
>>> Alex Sviridov
>>>
>>
>>
>>
>> --
>> Matt Sicker < [hidden email] >
>
>


--
Alex Sviridov