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

  • Home
  • SEARCH
  • 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 9176751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:10:45+00:00 2026-06-17T17:10:45+00:00

The SBT document says that When a command is run, more detailed logging output

  • 0

The SBT document says that “When a command is run, more detailed logging output is sent to a file than to the screen (by default). …”

Where is the logging file?

If I use a logging function in my program, where can I find those logs after the program is finished?

  • 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-17T17:10:47+00:00Added an answer on June 17, 2026 at 5:10 pm

    If you are simply trying to log to a file using an SLF4J compatible logger (as suggested by the link in your comment) I’d propose you use Logback for logging, as explained here.

    It is fairly simple to configure (for simple use cases), including where log outputs are sent to. The linked to tutorial only configures a console appender, that is, the logged output will be sent to the console. You can configure a FileAppender (i.e. sending log outputs to a file) like this (in your logback.xml):

    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
       <file>testFile.log</file>
       <append>true</append>
       <encoder>
         <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
       </encoder>
     </appender>
    

    And then changing <appender-ref ref="STDOUT" /> from the tutorial to <appender-ref ref="FILE" />. You should really take a look at the logback / SLF4J docs in order to figure out how to set up more complex logging configurations if you need it, but this should get you started.

    After setting everything up (i.e. adding logback as a dependency in build.sbt and creating your logback.xml configuration in src/main/resources), you can then invoke the logger like so:

    import org.slf4j.LoggerFactory
    import ch.qos.logback.core.util.StatusPrinter
    import ch.qos.logback.classic.LoggerContext
    
    object LogTester extends App{
      def logger = LoggerFactory.getLogger("KDURLFilter")
      StatusPrinter.print((LoggerFactory.getILoggerFactory).asInstanceOf[LoggerContext])
      logger.info("vikas")
    }
    

    Example

    I’ve created an example SBT project in which you can see a running logback configuration.

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

Sidebar

Related Questions

My scala/sbt project uses grizzled-slf4j and logback. A third-party dependency uses Apache Commons Logging.
Is it possible, with SBT to use a flat directory structure for multimodules? That
default SBT log level is info (see http://code.google.com/p/simple-build-tool/wiki/RunningSbt ). How do I set it
I have an entity Course that has a key to another entity (Document) inside.
I have a controller which should generate pdf file and after that should redirect
I create my pdf document out of a html File. I want to save
I have tried to install SBT on my macbook. When I run it, it
I am using sbt for an Akka project. I want to redirect the output
pre-sbt 0.10.0 used an sbt.boot.properties to define sbt's boot configuration file. What is the
In SBT .7, you could do ~jetty-run in order to get your files to

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.