The Interpolator is only checking for null. Likewise, I believe StrSubstitutor 
will only use the default value if the lookup returns null, not an empty string.

Ralph

> On Mar 11, 2016, at 7:23 AM, Andrei Ivanov <[email protected]> wrote:
> 
> Hi,
> As I didn't receive any answer, I hope I can send my questions here.
> 
> Have a nice day.
> 
> ---------- Forwarded message ----------
> From: Andrei Ivanov <[email protected] <mailto:[email protected]>>
> Date: Tue, Mar 8, 2016 at 5:12 PM
> Subject: default value for empty ${web:contextPath}
> To: [email protected] <mailto:[email protected]>
> 
> 
> Hello,
> In the hope that someone else might have a better solution, I'm trying here.
> 
> As you can see in
> http://stackoverflow.com/questions/35729590/log4j2-lookup-default-value-with-empty-contextpath,
> I'm trying to set the filename of an appender using the context path
> of the web application.
> 
> It works except the case when the app is deployed as the root of the
> virtual host, case when the contextPath is an empty string (not null).
> 
> The default (specified in the Properties section) is only used when
> the lookup returns null.
> 
> Is there anything else I can do besides writing a plugin just for this?
> 
> Regards
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] 
> <mailto:[email protected]>
> For additional commands, e-mail: [email protected] 
> <mailto:[email protected]>

Reply via email to