Code Monkey home page Code Monkey logo

Comments (8)

hazendaz avatar hazendaz commented on May 30, 2024

This wrapper library is default configured to behave just like tomcat. You can adjust as needed via the logback xml files.

from tomcat-slf4j-logback.

stripathi669 avatar stripathi669 commented on May 30, 2024

Any inputs on how to do the needed? As redirect console output to *.log files.

from tomcat-slf4j-logback.

hazendaz avatar hazendaz commented on May 30, 2024

In the logback.xml file, look at this entry...

    <appender name="CONSOLE" class="org.apache.juli.logging.ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %-5level {%thread} [%logger{20}] : %msg%n</pattern>
        </encoder>
    </appender>

Change that to match the others indicating where you want the 'catalina.out' to instead go to 'catalina.log'. That will capture all console output to the locaton you are after.

from tomcat-slf4j-logback.

hazendaz avatar hazendaz commented on May 30, 2024

Better answer...tomcat by default is using catalina.out. You can force writing away by deleting the CONSOLE appender I noted above and by setting the root logger differently in the logback.xml.

    <root level="INFO">
        <appender-ref ref="FILE-CATALINA" />
    </root>

Not certain why you might want to do this as its a tad different than the way tomcat works. You will still end up with a logger for catalina.out but it will be empty doing this. I'm going to close this issue. If you feel others might be interested in this configuration please write up a markdown doc and submit a pull request under a docs/ directory with motivation as to why one might want this style of configuration.

from tomcat-slf4j-logback.

hazendaz avatar hazendaz commented on May 30, 2024

Oh and I would add, the original idea I tossed out likely would have rolled without issue.

from tomcat-slf4j-logback.

hazendaz avatar hazendaz commented on May 30, 2024

Reopening issue as I didn't clearly understand the original concern. After a couple of years with logs in backup location, I clearly see that catalina.out is still populated heavily and never roles. Deeper looking into tomcat seems to indicate that the system out is set to catalina.out rather hard and we are probably not addressing it in any good way. I'm reviewing this now and wanted to note this is likely an issue...

from tomcat-slf4j-logback.

hazendaz avatar hazendaz commented on May 30, 2024

See here and here

from tomcat-slf4j-logback.

hazendaz avatar hazendaz commented on May 30, 2024

Closing again as this is not an issue with this framework. For other libraries including tomcat, it will use system out and there is nothing this library can do to catch it. Instead, to do so you would need to write a tomcat lifecycle listener that attempts to write it out. That however will only get you so far as other third parties can force logging back to system out unfortunately.

from tomcat-slf4j-logback.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.