You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Gaurav <ga...@gmail.com> on 2019/06/04 09:25:53 UTC

Why does the log4j2's ${web:rootDir} web lookup cause issues at the deployment in weblogic 12c?

The log4j2's web lookup - ${web:rootDir} seems to cause problems on weblogic 12c deployment.

I suspect that the log4j2 web-lookup plugin is not initialized when weblogic requests the logger at the start of deployment and is unable to create the file.

Details in the apache issue link and stackoverflow question.

links-
1. https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2624
2. https://stackoverflow.com/questions/56438982/why-does-the-log4j2s-webrootdir-web-lookup-cause-issues-at-the-deployment-i

Please assist.

Re: Why does the log4j2's ${web:rootDir} web lookup cause issues at the deployment in weblogic 12c?

Posted by Gaurav <ga...@gmail.com>.

On 2019/06/06 15:26:38, Matt Sicker <bo...@gmail.com> wrote: 
> Oooh, the dreaded vfs URL scheme. There's some special case support
> for vfs URLs in some code, but it's not pervasive IIRC.
> 
> On Thu, 6 Jun 2019 at 04:33, Gaurav <ga...@gmail.com> wrote:
> >
> >
> >
> > On 2019/06/04 17:14:09, Matt Sicker <bo...@gmail.com> wrote:
> > > Maybe WebLogic bundles Log4j2 as a server module already? Some other EE
> > > container servers do that.
> > >
> > > On Tue, Jun 4, 2019 at 11:46, Ralph Goers <ra...@dslextreme.com>
> > > wrote:
> > >
> > > > I am also unclear as to why this would be any different than any other
> > > > servlet container. I recall having seen an issue where the
> > > > contextInitialized method of Log4jServletContextListener was not being
> > > > called. I don’t believe we ever determined why it wasn’t happening.
> > > >
> > > > Ralph
> > > >
> > > > > On Jun 4, 2019, at 9:37 AM, Matt Sicker <bo...@gmail.com> wrote:
> > > > >
> > > > > I'm not sure if any of the developers here are using WebLogic. Do you
> > > > > think you can provide some sort of functional test or integration test
> > > > > that demonstrates the problem?
> > > > >
> > > > > On Tue, 4 Jun 2019 at 04:25, Gaurav <ga...@gmail.com> wrote:
> > > > >>
> > > > >> The log4j2's web lookup - ${web:rootDir} seems to cause problems on
> > > > weblogic 12c deployment.
> > > > >>
> > > > >> I suspect that the log4j2 web-lookup plugin is not initialized when
> > > > weblogic requests the logger at the start of deployment and is unable to
> > > > create the file.
> > > > >>
> > > > >> Details in the apache issue link and stackoverflow question.
> > > > >>
> > > > >> links-
> > > > >> 1. https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2624
> > > > >> 2.
> > > > https://stackoverflow.com/questions/56438982/why-does-the-log4j2s-webrootdir-web-lookup-cause-issues-at-the-deployment-i
> > > > >>
> > > > >> Please assist.
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Matt Sicker <bo...@gmail.com>
> > > > >
> > > >
> > > >
> > > > --
> > > Matt Sicker <bo...@gmail.com>
> > >
> >
> > As a workaround, I replaced web lookup with "configParentLocation" lookup. It seems to work on all containers except Jboss 7 eap. During the deployment, it throws the error - "Unable to create file vfs:/E:/JBOSS_DEPLOYMENT/test.war/WEB-INF/classes/../../logs/test.log java.io.IOException: The filename, directory name, or volume label syntax is incorrect"
> 
> 
> 
> -- 
> Matt Sicker <bo...@gmail.com>
> 
Any solution for this problem?
Will it be better to keep seperate log4j2.xml files for different container like JBoss/Weblogic/Tomcat.
Getting the context-path has become a big issue!

Re: Why does the log4j2's ${web:rootDir} web lookup cause issues at the deployment in weblogic 12c?

Posted by Matt Sicker <bo...@gmail.com>.
Oooh, the dreaded vfs URL scheme. There's some special case support
for vfs URLs in some code, but it's not pervasive IIRC.

On Thu, 6 Jun 2019 at 04:33, Gaurav <ga...@gmail.com> wrote:
>
>
>
> On 2019/06/04 17:14:09, Matt Sicker <bo...@gmail.com> wrote:
> > Maybe WebLogic bundles Log4j2 as a server module already? Some other EE
> > container servers do that.
> >
> > On Tue, Jun 4, 2019 at 11:46, Ralph Goers <ra...@dslextreme.com>
> > wrote:
> >
> > > I am also unclear as to why this would be any different than any other
> > > servlet container. I recall having seen an issue where the
> > > contextInitialized method of Log4jServletContextListener was not being
> > > called. I don’t believe we ever determined why it wasn’t happening.
> > >
> > > Ralph
> > >
> > > > On Jun 4, 2019, at 9:37 AM, Matt Sicker <bo...@gmail.com> wrote:
> > > >
> > > > I'm not sure if any of the developers here are using WebLogic. Do you
> > > > think you can provide some sort of functional test or integration test
> > > > that demonstrates the problem?
> > > >
> > > > On Tue, 4 Jun 2019 at 04:25, Gaurav <ga...@gmail.com> wrote:
> > > >>
> > > >> The log4j2's web lookup - ${web:rootDir} seems to cause problems on
> > > weblogic 12c deployment.
> > > >>
> > > >> I suspect that the log4j2 web-lookup plugin is not initialized when
> > > weblogic requests the logger at the start of deployment and is unable to
> > > create the file.
> > > >>
> > > >> Details in the apache issue link and stackoverflow question.
> > > >>
> > > >> links-
> > > >> 1. https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2624
> > > >> 2.
> > > https://stackoverflow.com/questions/56438982/why-does-the-log4j2s-webrootdir-web-lookup-cause-issues-at-the-deployment-i
> > > >>
> > > >> Please assist.
> > > >
> > > >
> > > >
> > > > --
> > > > Matt Sicker <bo...@gmail.com>
> > > >
> > >
> > >
> > > --
> > Matt Sicker <bo...@gmail.com>
> >
>
> As a workaround, I replaced web lookup with "configParentLocation" lookup. It seems to work on all containers except Jboss 7 eap. During the deployment, it throws the error - "Unable to create file vfs:/E:/JBOSS_DEPLOYMENT/test.war/WEB-INF/classes/../../logs/test.log java.io.IOException: The filename, directory name, or volume label syntax is incorrect"



-- 
Matt Sicker <bo...@gmail.com>

Re: Why does the log4j2's ${web:rootDir} web lookup cause issues at the deployment in weblogic 12c?

Posted by Gaurav <ga...@gmail.com>.

On 2019/06/04 17:14:09, Matt Sicker <bo...@gmail.com> wrote: 
> Maybe WebLogic bundles Log4j2 as a server module already? Some other EE
> container servers do that.
> 
> On Tue, Jun 4, 2019 at 11:46, Ralph Goers <ra...@dslextreme.com>
> wrote:
> 
> > I am also unclear as to why this would be any different than any other
> > servlet container. I recall having seen an issue where the
> > contextInitialized method of Log4jServletContextListener was not being
> > called. I don’t believe we ever determined why it wasn’t happening.
> >
> > Ralph
> >
> > > On Jun 4, 2019, at 9:37 AM, Matt Sicker <bo...@gmail.com> wrote:
> > >
> > > I'm not sure if any of the developers here are using WebLogic. Do you
> > > think you can provide some sort of functional test or integration test
> > > that demonstrates the problem?
> > >
> > > On Tue, 4 Jun 2019 at 04:25, Gaurav <ga...@gmail.com> wrote:
> > >>
> > >> The log4j2's web lookup - ${web:rootDir} seems to cause problems on
> > weblogic 12c deployment.
> > >>
> > >> I suspect that the log4j2 web-lookup plugin is not initialized when
> > weblogic requests the logger at the start of deployment and is unable to
> > create the file.
> > >>
> > >> Details in the apache issue link and stackoverflow question.
> > >>
> > >> links-
> > >> 1. https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2624
> > >> 2.
> > https://stackoverflow.com/questions/56438982/why-does-the-log4j2s-webrootdir-web-lookup-cause-issues-at-the-deployment-i
> > >>
> > >> Please assist.
> > >
> > >
> > >
> > > --
> > > Matt Sicker <bo...@gmail.com>
> > >
> >
> >
> > --
> Matt Sicker <bo...@gmail.com>
> 

As a workaround, I replaced web lookup with "configParentLocation" lookup. It seems to work on all containers except Jboss 7 eap. During the deployment, it throws the error - "Unable to create file vfs:/E:/JBOSS_DEPLOYMENT/test.war/WEB-INF/classes/../../logs/test.log java.io.IOException: The filename, directory name, or volume label syntax is incorrect"

Re: Why does the log4j2's ${web:rootDir} web lookup cause issues at the deployment in weblogic 12c?

Posted by Matt Sicker <bo...@gmail.com>.
Maybe WebLogic bundles Log4j2 as a server module already? Some other EE
container servers do that.

On Tue, Jun 4, 2019 at 11:46, Ralph Goers <ra...@dslextreme.com>
wrote:

> I am also unclear as to why this would be any different than any other
> servlet container. I recall having seen an issue where the
> contextInitialized method of Log4jServletContextListener was not being
> called. I don’t believe we ever determined why it wasn’t happening.
>
> Ralph
>
> > On Jun 4, 2019, at 9:37 AM, Matt Sicker <bo...@gmail.com> wrote:
> >
> > I'm not sure if any of the developers here are using WebLogic. Do you
> > think you can provide some sort of functional test or integration test
> > that demonstrates the problem?
> >
> > On Tue, 4 Jun 2019 at 04:25, Gaurav <ga...@gmail.com> wrote:
> >>
> >> The log4j2's web lookup - ${web:rootDir} seems to cause problems on
> weblogic 12c deployment.
> >>
> >> I suspect that the log4j2 web-lookup plugin is not initialized when
> weblogic requests the logger at the start of deployment and is unable to
> create the file.
> >>
> >> Details in the apache issue link and stackoverflow question.
> >>
> >> links-
> >> 1. https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2624
> >> 2.
> https://stackoverflow.com/questions/56438982/why-does-the-log4j2s-webrootdir-web-lookup-cause-issues-at-the-deployment-i
> >>
> >> Please assist.
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
>
>
> --
Matt Sicker <bo...@gmail.com>

Re: Why does the log4j2's ${web:rootDir} web lookup cause issues at the deployment in weblogic 12c?

Posted by Ralph Goers <ra...@dslextreme.com>.
I am also unclear as to why this would be any different than any other servlet container. I recall having seen an issue where the contextInitialized method of Log4jServletContextListener was not being called. I don’t believe we ever determined why it wasn’t happening.

Ralph

> On Jun 4, 2019, at 9:37 AM, Matt Sicker <bo...@gmail.com> wrote:
> 
> I'm not sure if any of the developers here are using WebLogic. Do you
> think you can provide some sort of functional test or integration test
> that demonstrates the problem?
> 
> On Tue, 4 Jun 2019 at 04:25, Gaurav <ga...@gmail.com> wrote:
>> 
>> The log4j2's web lookup - ${web:rootDir} seems to cause problems on weblogic 12c deployment.
>> 
>> I suspect that the log4j2 web-lookup plugin is not initialized when weblogic requests the logger at the start of deployment and is unable to create the file.
>> 
>> Details in the apache issue link and stackoverflow question.
>> 
>> links-
>> 1. https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2624
>> 2. https://stackoverflow.com/questions/56438982/why-does-the-log4j2s-webrootdir-web-lookup-cause-issues-at-the-deployment-i
>> 
>> Please assist.
> 
> 
> 
> -- 
> Matt Sicker <bo...@gmail.com>
> 



Re: Why does the log4j2's ${web:rootDir} web lookup cause issues at the deployment in weblogic 12c?

Posted by Matt Sicker <bo...@gmail.com>.
I'm not sure if any of the developers here are using WebLogic. Do you
think you can provide some sort of functional test or integration test
that demonstrates the problem?

On Tue, 4 Jun 2019 at 04:25, Gaurav <ga...@gmail.com> wrote:
>
> The log4j2's web lookup - ${web:rootDir} seems to cause problems on weblogic 12c deployment.
>
> I suspect that the log4j2 web-lookup plugin is not initialized when weblogic requests the logger at the start of deployment and is unable to create the file.
>
> Details in the apache issue link and stackoverflow question.
>
> links-
> 1. https://issues.apache.org/jira/projects/LOG4J2/issues/LOG4J2-2624
> 2. https://stackoverflow.com/questions/56438982/why-does-the-log4j2s-webrootdir-web-lookup-cause-issues-at-the-deployment-i
>
> Please assist.



-- 
Matt Sicker <bo...@gmail.com>