Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8204387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:53:08+00:00 2026-06-07T07:53:08+00:00

I am using log4j in my spring+struts+hibernate application.It is working perfectly but the only

  • 0

I am using log4j in my spring+struts+hibernate application.It is working perfectly but the only problem is the log file is stored in the specific path.Is there any way to change the path of the log file dynamically.I want the log file to be generating on the server path.

This is the property file am using for log4j

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
**log4j.appender.file.File=C:\\loging.log**
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

# Root logger option
log4j.rootLogger=debug, file, stdout

I want to load the server path dynamically here*log4j.appender.file.File=server path*.

Any idea?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:53:10+00:00Added an answer on June 7, 2026 at 7:53 am

    Refer

    http://www.developer.com/java/ent/dynamically-configure-log4j-properties-in-a-clustered-environment.html

    Log4j, configuring a Web App to use a relative path

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a web project. Which is generating log file using log4j. But
I am using this property file to setup log4j in Spring: log4j.appender.EMAIL=org.apache.log4j.net.SMTPAppender log4j.appender.EMAIL.filter=org.apache.log4j.varia.LevelRangeFilter log4j.appender.EMAIL.filter.levelMin=FATAL
In my project I'm using log4j to log errors and many frameworks: AOP, spring
I am using Spring & Hibernate in my application and I want to set
I'm implementing a logger as an aspect using Spring AOP and Log4J, but I've
I am developing an application using SPRING 3.0.4, JPA 2, Hibernate 3.5.5. I an
When using log4j, the Logger.log(Priority p, Object message) method is available and can be
I'm using log4j in an app I'm developing to eventually run inside Tomcat/JBoss, but
My procedure for using log4j is this: put a .properties file somewhere in a
I'm using log4j for record my program's log. The code is like this: static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.