Re: how to use external log4j2 property file

Matt Sicker <[email protected]>
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <[email protected]>
That’s a system property to set on the java command line invocation of your application.

—
Matt Sicker

> On Jan 5, 2022, at 10:51, Jin, Ying <[email protected]> wrote:
> 
> Can you let me know where I should put the following property in the application? Thanks!
> 
> -Dlog4j2.debug=true
> 
> From: Jin, Ying <[email protected]>
> Sent: Wednesday, January 5, 2022 9:34 AM
> To: [email protected]
> Subject: RE: RE: how to use external log4j2 property file
> 
> 
>> On 2022/01/05 02:16:47 "Jin, Ying" wrote:
>> Hello,
>> 
>> We have a requirement to use external server-side log4j2.properties file for our log4j2 upgrade projects. After using the following jar files in the project and use the code below to configure log4j with an external log4j2 property file. We still see logging output goes to the WebLogic console instead of the application's log file.
> 
>> 
>> If we put the log4j2.properties file in the project's classpath, the application log file can be generated on the server. However, we're required to use the external server side log4j property file.
> 
>> 
>> log4j-api-2.17.0.jar
>> log4j-core-2.17.0.jar
>> 
>> LoggerContext context = (LoggerContext) LogManager.getContext(false);
>> context.setConfigLocation(new File(log4jConfigurationPath).toURI());
>> 
>> Please help shed some light on this. We've spent much time and efforts on this issue, but still no luck.
>> 
>> Your help is much appreciated,
>> Jenny
>> 
>> 
>> 
>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.