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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:49:00+00:00 2026-06-01T14:49:00+00:00

Can we able to create two instance of log4j in class one to write

  • 0

Can we able to create two instance of log4j in class one to write in file and another in jdbcadapter?

// one to write log in console
Logger log = Logger.getLogger(this.getClass()); 

// write in database within one class 
Logger log1 = Logger.getLogger(this.getClass()); 

My jdbc adapter is

My file adapter is

I wan to Logger instance log for File anmd Logger instant log1 for jdbc.

  • 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-01T14:49:02+00:00Added an answer on June 1, 2026 at 2:49 pm

    In log4j there are various Appenders available, with descriptive names, such as FileAppender, ConsoleAppender, SocketAppender, SyslogAppender, NTEventLogAppender and even SMTPAppender. Multiple Appenders can be attached to any Logger, so it’s possible to log the same information to multiple outputs; for example to a file locally and to a socket listener on another computer.

    Moreover if want to write logs to different outputs according to the level then you could try Log to appender by level.

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

Sidebar

Related Questions

I want to create a class that wraps another class so that when a
I want two generic classes to be able to reference each other. I can't
I have a class that has two method in it, one calls a class
I created a CustomButtonField in blackberry using that i can able to set our
I can able to post the tweet through my application using C# with twitterizer
I have implemented Google Analytics in my iPhone Application. And I can able to
The media player embedded code work only in IE.How I can do it able
I am using the Nitrogen version of Frama-c on Mac, and can't seem able
Can a Java Applet able to print out text/html easily to standard printer driver(s)
Can anyone suggest a CMS able to offer the following features: Free/open source Support

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.