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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:22:29+00:00 2026-05-27T13:22:29+00:00

I am creating a solution for my application log, which have various types of

  • 0

I am creating a solution for my application log, which have various types of logging (user, application, etc…), wanted to save each type of log in a separate file.

This is possible with log4j or some other API?
How could I do that?

If you deem interesting, I edit the question and put the codes, but I do not think it’s worth, they are still very basic.

Thanks in advance.

  • 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-27T13:22:29+00:00Added an answer on May 27, 2026 at 1:22 pm

    Of cource, use different FileAppenders
    Example from internet:

    log4j.rootLogger=DEBUG
    
    # AdminFileAppender - used to log messages in the admin.log file.
    log4j.appender.AdminFileAppender=org.apache.log4j.FileAppender
    
    log4j.appender.AdminFileAppender.File=admin.log
    
    log4j.appender.AdminFileAppender.layout=org.apache.log4j.PatternLayout
    log4j.appender.AdminFileAppender.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n
    
    # ReportFileAppender - used to log messages in the report.log file.
    log4j.appender.ReportFileAppender=org.apache.log4j.FileAppender
    
    log4j.appender.ReportFileAppender.File=report.log
    
    log4j.appender.ReportFileAppender.layout=org.apache.log4j.PatternLayout
    log4j.appender.ReportFileAppender.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n
    
    log4j.logger.com.vaannila.admin=WARN,AdminFileAppender 
    log4j.logger.com.vaannila.report=DEBUG,ReportFileAppender 
    

    Now you can log to admin.log Logger.getLogger("com.vaannila.admin").log("To admin log") and to report log Logger.getLogger("com.vaannila.report").log("To report log")

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

Sidebar

Related Questions

I have wrote an application that consists of two projects in a solution, each
I am creating a client side application which needs to create a log of
I am creating application in which I would have database which users can´t edit.
I am creating solution and inside I have three projects: A WCF Service Library
I'm creating a server/client solution with custom user logins (not WindowsIdentity). I need a
I am currently creating a console application which is reading from a folder which
I'm creating an application in Visual Studio which uses web reference. The URL for
I am creating one application in .net MVC, in which I am using jQuery
I'm getting started with Silverlight. When creating a new solution I have the option
I am creating a application using jmf that will be launched on a user's

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.