Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

2 'Sling Logging Logger Configuration' with same Logger Names, but different levels

Avatar

Avatar
Validate 1
Level 2
paulj62699559
Level 2

Likes

3 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
paulj62699559
Level 2

Likes

3 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
paulj62699559
Level 2

11-10-2016

Hello,

I’m trying to create two Sling Logging Logger Configuration one for the log level “INFO” and one for the log level “WARN”, and both for the same Logger Name.

But only the “INFO” level one is working. It’s not possibly to log the same logger name at different levels into two different files?

Here is my code :

#org.apache.sling.commons.log.LogManager.factory.config-1

org.apache.sling.commons.log.LogManager.factory.config.1.org.apache.sling.commons.log.level="warn"

org.apache.sling.commons.log.LogManager.factory.config.1.org.apache.sling.commons.log.file="logs/1.log"

org.apache.sling.commons.log.LogManager.factory.config.1.org.apache.sling.commons.log.names="[name1,name2]"

 

#org.apache.sling.commons.log.LogManager.factory.config-2

org.apache.sling.commons.log.LogManager.factory.config.2.org.apache.sling.commons.log.level="info"

org.apache.sling.commons.log.LogManager.factory.config.2.org.apache.sling.commons.log.file="logs/2.log"

org.apache.sling.commons.log.LogManager.factory.config.2.org.apache.sling.commons.log.names="[name1,name2]"

Replies

Avatar

Avatar
Affirm 1
Level 1
radhabbharathi
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

2 solutions
Top badges earned
Affirm 1
View profile

Avatar
Affirm 1
Level 1
radhabbharathi
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

2 solutions
Top badges earned
Affirm 1
View profile
radhabbharathi
Level 1

11-10-2016

I dont think its possible,when i tried configuring 2nd logged  via http://localhost:4502/system/console/slinglog , it didnt even allow me to save the second entry.

Avatar

Avatar
Validate 1
Level 6
rush_pawan
Level 6

Likes

79 likes

Total Posts

152 posts

Correct Reply

63 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
Level 6
rush_pawan
Level 6

Likes

79 likes

Total Posts

152 posts

Correct Reply

63 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
rush_pawan
Level 6

11-10-2016

Hello,

It will not allow you to do that until you are not using common logging name. One thing which is not clear to me, why you want to create same login twice because OOTB INFO will also cover WARN logs (until you override initvalue for log) so why you want two.

 

Thanks,

Pawan

Avatar

Avatar
Validate 1
Level 2
paulj62699559
Level 2

Likes

3 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
paulj62699559
Level 2

Likes

3 likes

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
paulj62699559
Level 2

12-10-2016

Hi, thanks for the answer.

I want to create 2 log files because we use another application which display logs by log files.

On one window we want to display only errors, and on the other we want to display info logs (no problem if there is also errors inside).

 

What do you mean by 'It will not allow you to do that until you are not using common logging name' ?

On the example, we replaced the 'real names' by [name1,name2], but it's just for the example.