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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:05:54+00:00 2026-06-08T23:05:54+00:00

In log4j.properties I can set PatternLayout e.g. ([%p] %c – %m – %d %n)

  • 0

In log4j.properties I can set PatternLayout e.g. ("[%p] %c - %m - %d %n")

Is there any symbol (%something) which returns current time in milliseconds?

  • 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-08T23:05:56+00:00Added an answer on June 8, 2026 at 11:05 pm

    There is no Log4J symbol that does exactly what you want.

    %d returns the current date with a given pattern, defined by a SimpleDateFormat (the pattern you put between the brackets), but doesn’t give you the time in millis.

    %r gives the number of milliseconds since the start of execution.

    One possible way of achieving what you want is to extend the behaviour of Log4j, it’s quite a bit more complex, but if it’s absolutely necessary… here you go:

    Customize log4j (edit: no longer online?)
    Customize log4j (edit: 2018 alternative)

    Edit:
    Keep in mind that, from your comment, if you need to figure out time differences between executions in different machines, you have to make sure the clocks of the machines are synchronized, or it’ll be leading you to wrong conclusions.

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

Sidebar

Related Questions

I use log4j as logger for my web application. in log4j, I can set
I'm trying to figure out how I can manage my log4j.properties file with leiningen.
how can i configure a log4j.properties with a rootlogger = debug, stdout, logfile and
Can you use an env var expansion such as %APPDATA% in log4j.properties file? I
I have a log4j properties something like below. Everything that is logged in TextProcessor.log
log4j.rootCategory field in log4j.properties can have 4 different values, namely: DEBUG , WARN ,
How can one quickly turn off all Log4J output using a log4j.properties file?
I have a log4j properties file which is creating a file inside my tomcat>bin
I have a jar in the classpath of my server which contains the log4j.properties
In a web-module you can place the log4j.properties on the classpath and log4j's default

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.