Re: default value for missing key in mdc

2013-10-20 Thread Woonsan Ko
I uploaded a patch for the issue (to allow inline default value setting in general after the variable name and the delimiter): - https://issues.apache.org/jira/browse/LOG4J2-419 Please take a review. Cheers, Woonsan > On Wednesday, October 9, 2013 4:19 PM, Ralph Goers > wrote: > > Please

Re: default value for missing key in mdc

2013-10-09 Thread Remko Popma
Yes. Anyone can read existing issues, but to add or comment you need to create an account. Best regards, Remko On Thursday, October 10, 2013, Jonathan Willis wrote: > i am able to view the jira page, and i have been there before, but i don't > see how to add an issue. Do i need credentials to lo

Re: default value for missing key in mdc

2013-10-09 Thread Jonathan Willis
i am able to view the jira page, and i have been there before, but i don't see how to add an issue. Do i need credentials to log in? On Wed, Oct 9, 2013 at 5:43 PM, Remko Popma wrote: > Oh. Sorry. Here you are: > http://logging.apache.org/log4j/2.x/issue-tracking.html > > Sent from my iPhone >

Re: default value for missing key in mdc

2013-10-09 Thread Remko Popma
Oh. Sorry. Here you are: http://logging.apache.org/log4j/2.x/issue-tracking.html Sent from my iPhone > On 2013/10/10, at 8:25, Jonathan Willis wrote: > > How do you create a jira ticket? I looked for where i could but i didnt see > anywhere that said add issue >> On Oct 9, 2013 4:47 PM, "Remko

Re: default value for missing key in mdc

2013-10-09 Thread Jonathan Willis
How do you create a jira ticket? I looked for where i could but i didnt see anywhere that said add issue On Oct 9, 2013 4:47 PM, "Remko Popma" wrote: > Jonathan, > Would you mind raising a JIRA ticket for the issue you're reporting? > That makes it easier for us to track and easier for you to att

Re: default value for missing key in mdc

2013-10-09 Thread Remko Popma
Jonathan, Would you mind raising a JIRA ticket for the issue you're reporting? That makes it easier for us to track and easier for you to attach config files or image files. (The mailing list software may not like image file attachments...) Best regards, Remko Sent from my iPhone > On 2013/10/

Re: default value for missing key in mdc

2013-10-09 Thread Jonathan Willis
[image: Inline image 1] [image: Inline image 2] On Wed, Oct 9, 2013 at 3:05 PM, Ralph Goers wrote: > Can you provide your lookup source? > > > On Oct 9, 2013, at 1:22 PM, Jonathan Willis > wrote: > > > > http://stackoverflow.com/questions/19277445/how-to-use-map-lookups-using-log4j2 > > > > > >

Re: default value for missing key in mdc

2013-10-09 Thread Ralph Goers
Can you provide your lookup source? On Oct 9, 2013, at 1:22 PM, Jonathan Willis wrote: > http://stackoverflow.com/questions/19277445/how-to-use-map-lookups-using-log4j2 > > > On Wed, Oct 9, 2013 at 2:18 PM, Ralph Goers wrote: > >> Please remember that mine is just one opinion, but I am fine

Re: default value for missing key in mdc

2013-10-09 Thread Jonathan Willis
http://stackoverflow.com/questions/19277445/how-to-use-map-lookups-using-log4j2 On Wed, Oct 9, 2013 at 2:18 PM, Ralph Goers wrote: > Please remember that mine is just one opinion, but I am fine with that. I > guess if no default value is provided this way then it can still fall back > to lookin

Re: default value for missing key in mdc

2013-10-09 Thread Ralph Goers
Please remember that mine is just one opinion, but I am fine with that. I guess if no default value is provided this way then it can still fall back to looking in the properties map. Ralph On Oct 9, 2013, at 12:53 PM, Woonsan Ko wrote: > Hi Ralph, > > > I have something related to this im

Re: default value for missing key in mdc

2013-10-09 Thread Woonsan Ko
Hi Ralph, I have something related to this improvement idea. I have thought it might be a bit more useful and flexible to allow default value in the variable expression itself. For example, ${var1:-defvalue1}, ${ctx:request_id:-defvalue2}, etc. This generic feature has been included in StrSubsti

Re: default value for missing key in mdc

2013-10-01 Thread Ralph Goers
Patches are always welcome! Ralph On Oct 1, 2013, at 1:13 AM, Oliver Flege wrote: >> $${mdc:request_id} in a pattern should cause the request_id to be evaluated >> on every event. > > thanks a lot, $${ctx:request_id} seems to do the trick > > however, the computation of the default value is

Re: default value for missing key in mdc

2013-10-01 Thread Oliver Flege
> $${mdc:request_id} in a pattern should cause the request_id to be evaluated > on every event. > thanks a lot, $${ctx:request_id} seems to do the trick however, the computation of the default value is quite complex as it always involves a variable substitution, and I cannot use conversion spe

Re: default value for missing key in mdc

2013-09-30 Thread Ralph Goers
$${mdc:request_id} in a pattern should cause the request_id to be evaluated on every event. Ralph > On Sep 30, 2013, at 8:04 AM, Oliver Flege wrote: > > ok, this works for ${...} expressions in the configuration, but I don't see > how it would > apply to pattern evaluation. To simplify and re

Re: default value for missing key in mdc

2013-09-30 Thread Oliver Flege
ok, this works for ${...} expressions in the configuration, but I don't see how it would apply to pattern evaluation. To simplify and rephrase my original question: Given a pattern layout with a pattern like: %X{REQUEST_ID} is it possible to define a default value that will be printed if the th

Re: default value for missing key in mdc

2013-09-30 Thread Ralph Goers
Yes, it supports default values. Specify them as properties at the beginning of your configuration. Then when you specify something like ${sys:foo} if foo is not defined as a system property the default value will be used, Ralph > On Sep 30, 2013, at 3:30 AM, Oliver Flege wrote: > > Hi, > >

default value for missing key in mdc

2013-09-30 Thread Oliver Flege
Hi, I am considering to switch from slf4j/logback to log4j2; in slf4j/logback, I can specify a default value for a missing mdc entry like this: %d{HH:mm:ss} %X{FOO:--} %c{0} - %m%n which would print "-" if mdc.get("FOO") is null (the ":-" separates the key and the default value). Having a defi