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 8340133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:05:43+00:00 2026-06-09T05:05:43+00:00

This is the configuration of log4j in lift <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE log4j:configuration SYSTEM

  • 0

This is the configuration of log4j in lift

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM
        "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration threshold="trace" xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="CA" class="org.apache.log4j.FileAppender">
        <param name="File" value="sample.log"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="[%d{ISO8601}] %-8r [%t] %-5p %c %x - %m%n"/>
        </layout>
    </appender>
    <root>
        <level value="trace"/>
        <appender-ref ref="CA"/>
    </root>
</log4j:configuration>

This is the relevant part in Boot.scala

Logger.setup = Full(Log4j.withFile(getClass.getResource("/props/default.log4j.xml")))

I run the lift app on jetty 6.22. When i start jetty with “jetty service start”,
It creates the log file in the jetty tmp_dir folder /var/cache/jetty/tmp/sample.log

How can i configure it to create the log files in another location? for exmaple the jetty logs folder.

  • 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-09T05:05:45+00:00Added an answer on June 9, 2026 at 5:05 am

    As you only use the filename ‘sample.log’ in your FileAppender declaration then Jetty stores the log file in its working directory.

    The solution is to specify an absolute path, or potentially using a variable. For instance:

    <param name="File" value="${java.io.tmpdir}/sample.log"/>
    

    Would store sample.log in java.io.tmpdir which is OS dependent.

    The value inside the curly braces is a system property. You can specify anything as a system property on the command line and then access it in your Log4J file. For example:

    java -Dmyloggingdir=/var/tmp/myloggingdir
    

    And then:

    <param name="File" value="${myloggingdir}/sample.log"/>
    

    If the Jetty logging directory is a system property then you should be able to access it.

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

Sidebar

Related Questions

i have little question, my log4j.xml configuration is listed below <?xml version=1.0 encoding=UTF-8 ?>
I have this ant script to run: <?xml version=1.0 encoding=utf-8?> <project name=WebserviceClient> <property file=myaxis.properties/>
This is my configuration : <org.springframework.version>3.1.0.RELEASE</org.springframework.version> <spring.data.mongo.version>1.0.0.RC1</spring.data.mongo.version> Is it possible to split from this
I have this log4j configuration in my grails config.groovy log4j = { error 'org.codehaus.groovy.grails.web.servlet',
On Jenkins configuration page in section Jenkins URL I've set this option to http://name_of_my_machine.jenkins:8080/
This is my log4j configuration file, whenever I run the batch file to execute
If my log4j.properties looks this # General configuration log4j.rootLogger = ERROR, ConsoleAppender # Appender
I am trying to create 2 log files using log4j using this configuration: log4j.rootLogger=debug,stdout,logfile
I have following information in log4j.properties file.. log4j.appender.file = org.apache.log4j.DailyRollingFileAppender log4j.appender.file.File = C:\\app\\file.log log4j.appender.file.Threshold
I have this code with log4j, I don't use any kind of configuration files

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.