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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:22:35+00:00 2026-06-02T01:22:35+00:00

I’m using logback for logging of a Java web service app, using embedded Jetty.

  • 0

I’m using logback for logging of a Java web service app, using embedded Jetty. The logging works as expected based on the logback.xml file… all except for some logs originating in Java, but showing up in the jsvc output to stderr.

I would like specifically to see all my Java-generated logs with millisecond timestamps to match my other logs, and ones showing up in the jsvc stderr output are only down to the second.

The jsvc stdout logs are mostly generated from Jersey and I see my own code referenced as objects are registered with Guice, which gives me hope that it can be controlled through logback. I don’t understand what causes those logs to show up in jsvc’s stderr output rather than in the logback catchall. Has anyone solved a similar problem in their code or configuration when using jsvc?

  • 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-02T01:22:36+00:00Added an answer on June 2, 2026 at 1:22 am

    The solution required changes in a few places, and was largely an slf4j configuration issue. My app has numerous dependencies, and they introduce a variety of logging implementations. Slf4j was designed to corral them all together, and the process is often just an easy drop-in of a jar, but java.util.logging takes a bit more effort.

    The slf4j Bridging Legacy APIs page describes (mostly) how to wire up the JUL dependency introduced by Jersey. I had already included the jul-to-slf4j.jar, but it wasn’t wired up correctly. I needed to execute SLF4JBridgeHandler.install() in the initialization of my app. In addition, the page cautions about negative performance implications unless I also include the following in my logback.xml file:

    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
        <resetJUL>true</resetJUL>
    </contextListener>
    

    That got me most of the way there, but introduced duplication of log events– one went to slf4j and the other continued to stderr. Google directed me to an article in Claus Neilsen’s Blog, “Bridging java.util.logging to SLF4J“. This contained a helpful snippet of code:

    // Jersey uses java.util.logging - bridge to slf4
    java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger("");
    Handler[] handlers = rootLogger.getHandlers();
    for (int i = 0; i < handlers.length; i++) {
        rootLogger.removeHandler(handlers[i]);
    }
    SLF4JBridgeHandler.install();
    

    With that in place, the Jersey logs that were showing up in my jsvc stderr output are now showing up with the rest of my logs, nicely formatted, as directed by logback.xml.

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

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
That's pretty much it. I'm using Nokogiri to scrape a web page what has
In my XML file chapters tag has more chapter tag.i need to display chapters
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm parsing an XML file, the creators of it stuck in a bunch social
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.