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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:59:55+00:00 2026-05-12T15:59:55+00:00

In a large application logging is essential, but when many developers work on the

  • 0

In a large application logging is essential, but when many developers work on the code, the logs can become chaotic. One might write:

log.info("Loaded " + rowCount + " recodrs from the database.");

Another might do something like:

log.debug("Records read={}", rowCount);

A third developer might think this is the proper way:

log.trace("Record(s) read: " + NumberFormat.getInstance().format(rowCount)
          + ", values: " + values);

This will result in logs that are hard to read, and much harder to parse.

What guidance can you give developers to produce logs that have a chance to be consistent, and actually be usable by other people? Will a policy about logging do any good? And if so, what should it include? Should there be an API (above the logging framework’s own) to enforce this policy?

I’m also curious about how to make the code look alike, but the more important question is about the actual output.

  • 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-05-12T15:59:55+00:00Added an answer on May 12, 2026 at 3:59 pm

    IMHO logging guidelines on what constitutes a good log statement level are rare even among large frameworks and products, primarily due more important guidelines involving

    • Log verbosity – more verbose statements should appear as debug statements, and calls to log.debug() should be wrapped by with a call to check whether debug is enabled. Developers often need to get the distinction between FATAL, ERROR, INFO, DEBUG and TRACE correct – not all exceptions are fatal, and not all messages are informative.
    • Use of TRACE or equivalent – this should be reserved for execution flow. Ideally, no other log statements are required to indicate control flow.
    • DEBUG vs INFO – DEBUG statements are often meant for developers and support personnel; INFO is often for users and administrators.
    • override toString() – it is helpful for logging the state of complex objects

    That said, I follow a few general thumb rules at the lowest level:

    • Log data as is, without formatting. That way, in case of an error, I know what was the data that caused the problem, instead of doubting the logger, the formatter and the application at the same time.
    • Avoid creating too many String objects unless you are running with DEBUG or TRACE switched on. In short, avoid concatenating too many strings. Even if log4j eventually checks if DEBUG is enabled or not, the String objects have been created, and that’s why log call wrapping is important. slf4j helps avoids this via the use of parameterized messages.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 343k
  • Answers 343k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Edit: It is possible now, to delete a project without… May 14, 2026 at 5:24 am
  • Editorial Team
    Editorial Team added an answer Sorry I was confused by what you were looking for,… May 14, 2026 at 5:24 am
  • Editorial Team
    Editorial Team added an answer Actually, just performing a lock in one place on the… May 14, 2026 at 5:24 am

Related Questions

I'm investigating the differences between using log4net and System.Diagnostics.Trace for logging, and I'm curious
I was curious as to what other shops are doing regarding base application frameworks?
Here at work we have a very large application with multiple sub applications. (500
I have a logger system which basically is a fancy way of writing my

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.