Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Matt Sicker
The SMTP appender would work well as a sample for that idea as we don't have a Slack appender yet (though I do have a ticket open for a generic HTTP appender which could be used as one). Also, after the site is integrated, we can start talking about 2.8.1. On 23 February 2017 at 21:58, Apache

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Apache
Either that or create an sample in the examples project. Speaking of, that needs to move to its own repo. I think I should have time to get the Scala stuff linked to the web site this weekend. Maybe I can split out the examples too. Ralph > On Feb 23, 2017, at 8:56 PM, Apache

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Apache
Actually, that would be a good use case to document on the web site. The example that is up there is completely contrived. I made it up just to have something to use to explain it. But a real-world example would probably be much better. Ralph > On Feb 23, 2017, at 8:54 PM, Matt Sicker

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Matt Sicker
I haven't used markers much, but I've finally figured out an interesting use case for them at work: marking log messages to filter them into a Slack message. Right now we've got people using random Slack libraries to post messages in team channels to alert various things, yet a simple appender

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Apache
Yeah, but it makes me wonder if anyone is using Markers. That bug was found over 5 years ago during performance testing of an app at my former employer when they were still using Logback. It received no votes in Jira and no one saying “me too”. If they were doing any kind of logging with the

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Matt Sicker
That's good to hear! A lot of people still use SLF4J with Log4j 2, so anything that makes them more performant is a nice bonus. On 23 February 2017 at 21:29, Apache wrote: > I tested SLF4J after the fix and on my computer the performance problem > does seem to have

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Apache
I tested SLF4J after the fix and on my computer the performance problem does seem to have been addressed and the code should now be thread safe. Ralph > On Feb 23, 2017, at 2:39 PM, Apache wrote: > > And that issue has now been marked closed. However, there are

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Matt Sicker
For the CONFIG level, you could match it to the same one in log4j-jul: https://logging.apache.org/log4j/2.x/log4j-jul/apidocs/src-html/org/apache/logging/log4j/jul/LevelTranslator.html#line.43 On 23 February 2017 at 15:39, Apache wrote: > And that issue has now been

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Apache
And that issue has now been marked closed. However, there are still a couple of synchronized methods in there that are called on every filter comparison so we will have to rerun our performance benchmarks to see if it made a significant difference. Ralph > On Feb 23, 2017, at 2:30 PM, Apache

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Apache
Markers would work but I wouldn’t recommend using them with SLF4J. See https://jira.qos.ch/browse/SLF4J-240 . It has been open for over 5 years so I’m of the impression it will never be fixed.

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Marshall Schor
On 2/23/2017 1:09 PM, Apache wrote: > You shouldn’t be trying to modify the logger. You should be trying to modify > the configuration. Take a look at > http://logging.apache.org/log4j/2.x/manual/customconfig.html#Programmatically_Modifying_the_Current_Configuration_after_Initialization > >

Re: Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Apache
You shouldn’t be trying to modify the logger. You should be trying to modify the configuration. Take a look at http://logging.apache.org/log4j/2.x/manual/customconfig.html#Programmatically_Modifying_the_Current_Configuration_after_Initialization

Using API to set filter on Logger - is ignored by code path Logger.isEnabled() ?

2017-02-23 Thread Marshall Schor
Hi, I'm writing test cases, using version 2.8 of Log4j. One test sets a filter on a logger. Looking (afterwards) at the logger, I see that the logger has a field: "privateConfig", and that has two fields for configuration info: - config (set to an instance of XmlConfiguration) - loggerConfig