How do I disable logging for a specific dependency in SBT?











up vote
8
down vote

favorite
1












I have the following build.sbt file:



version := "0.1"

scalaVersion := "2.10.0-RC1"

scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")

resolvers ++= Seq(
"sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/",
"sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
"typesafe repo" at "http://repo.typesafe.com/typesafe/releases/",
"spray repo" at "http://repo.spray.io/"
)

libraryDependencies ++= Seq(
"io.spray" % "spray-can" % "1.1-M4.2"
,"io.spray" % "spray-routing" % "1.1-M4.2"
,"io.spray" % "spray-testkit" % "1.1-M4.2"
,"io.spray" %% "spray-json" % "1.2.2" cross CrossVersion.full
,"com.typesafe.akka" %% "akka-actor" % "2.1.0-RC1" cross CrossVersion.full
,"org.specs2" %% "specs2" % "1.12.2" % "test" cross CrossVersion.full
,"com.typesafe" % "slick_2.10.0-RC1" % "0.11.2"
,"com.h2database" % "h2" % "1.3.166"
,"org.xerial" % "sqlite-jdbc" % "3.6.20"
,"org.slf4j" % "slf4j-api" % "1.6.4"
,"ch.qos.logback" % "logback-classic" % "1.0.7"
,"org.specs2" % "specs2_2.10.0-RC1" % "1.12.2" % "test"
,"junit" % "junit" % "4.8.1" % "test"
)


How do I enable DEBUG level reporting for my own (the current) project, but disable it for another. In this case I don't want to see the Slick library's debug output, but still want to see debug logging for my own project.










share|improve this question






















  • In log4j.xml you can configure log level for each library.
    – Rajesh Pitty
    Nov 8 '12 at 10:13















up vote
8
down vote

favorite
1












I have the following build.sbt file:



version := "0.1"

scalaVersion := "2.10.0-RC1"

scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")

resolvers ++= Seq(
"sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/",
"sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
"typesafe repo" at "http://repo.typesafe.com/typesafe/releases/",
"spray repo" at "http://repo.spray.io/"
)

libraryDependencies ++= Seq(
"io.spray" % "spray-can" % "1.1-M4.2"
,"io.spray" % "spray-routing" % "1.1-M4.2"
,"io.spray" % "spray-testkit" % "1.1-M4.2"
,"io.spray" %% "spray-json" % "1.2.2" cross CrossVersion.full
,"com.typesafe.akka" %% "akka-actor" % "2.1.0-RC1" cross CrossVersion.full
,"org.specs2" %% "specs2" % "1.12.2" % "test" cross CrossVersion.full
,"com.typesafe" % "slick_2.10.0-RC1" % "0.11.2"
,"com.h2database" % "h2" % "1.3.166"
,"org.xerial" % "sqlite-jdbc" % "3.6.20"
,"org.slf4j" % "slf4j-api" % "1.6.4"
,"ch.qos.logback" % "logback-classic" % "1.0.7"
,"org.specs2" % "specs2_2.10.0-RC1" % "1.12.2" % "test"
,"junit" % "junit" % "4.8.1" % "test"
)


How do I enable DEBUG level reporting for my own (the current) project, but disable it for another. In this case I don't want to see the Slick library's debug output, but still want to see debug logging for my own project.










share|improve this question






















  • In log4j.xml you can configure log level for each library.
    – Rajesh Pitty
    Nov 8 '12 at 10:13













up vote
8
down vote

favorite
1









up vote
8
down vote

favorite
1






1





I have the following build.sbt file:



version := "0.1"

scalaVersion := "2.10.0-RC1"

scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")

resolvers ++= Seq(
"sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/",
"sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
"typesafe repo" at "http://repo.typesafe.com/typesafe/releases/",
"spray repo" at "http://repo.spray.io/"
)

libraryDependencies ++= Seq(
"io.spray" % "spray-can" % "1.1-M4.2"
,"io.spray" % "spray-routing" % "1.1-M4.2"
,"io.spray" % "spray-testkit" % "1.1-M4.2"
,"io.spray" %% "spray-json" % "1.2.2" cross CrossVersion.full
,"com.typesafe.akka" %% "akka-actor" % "2.1.0-RC1" cross CrossVersion.full
,"org.specs2" %% "specs2" % "1.12.2" % "test" cross CrossVersion.full
,"com.typesafe" % "slick_2.10.0-RC1" % "0.11.2"
,"com.h2database" % "h2" % "1.3.166"
,"org.xerial" % "sqlite-jdbc" % "3.6.20"
,"org.slf4j" % "slf4j-api" % "1.6.4"
,"ch.qos.logback" % "logback-classic" % "1.0.7"
,"org.specs2" % "specs2_2.10.0-RC1" % "1.12.2" % "test"
,"junit" % "junit" % "4.8.1" % "test"
)


How do I enable DEBUG level reporting for my own (the current) project, but disable it for another. In this case I don't want to see the Slick library's debug output, but still want to see debug logging for my own project.










share|improve this question













I have the following build.sbt file:



version := "0.1"

scalaVersion := "2.10.0-RC1"

scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")

resolvers ++= Seq(
"sonatype releases" at "https://oss.sonatype.org/content/repositories/releases/",
"sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/",
"typesafe repo" at "http://repo.typesafe.com/typesafe/releases/",
"spray repo" at "http://repo.spray.io/"
)

libraryDependencies ++= Seq(
"io.spray" % "spray-can" % "1.1-M4.2"
,"io.spray" % "spray-routing" % "1.1-M4.2"
,"io.spray" % "spray-testkit" % "1.1-M4.2"
,"io.spray" %% "spray-json" % "1.2.2" cross CrossVersion.full
,"com.typesafe.akka" %% "akka-actor" % "2.1.0-RC1" cross CrossVersion.full
,"org.specs2" %% "specs2" % "1.12.2" % "test" cross CrossVersion.full
,"com.typesafe" % "slick_2.10.0-RC1" % "0.11.2"
,"com.h2database" % "h2" % "1.3.166"
,"org.xerial" % "sqlite-jdbc" % "3.6.20"
,"org.slf4j" % "slf4j-api" % "1.6.4"
,"ch.qos.logback" % "logback-classic" % "1.0.7"
,"org.specs2" % "specs2_2.10.0-RC1" % "1.12.2" % "test"
,"junit" % "junit" % "4.8.1" % "test"
)


How do I enable DEBUG level reporting for my own (the current) project, but disable it for another. In this case I don't want to see the Slick library's debug output, but still want to see debug logging for my own project.







scala sbt slf4j logback slick






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 '12 at 9:59









Jack

9,3891075146




9,3891075146












  • In log4j.xml you can configure log level for each library.
    – Rajesh Pitty
    Nov 8 '12 at 10:13


















  • In log4j.xml you can configure log level for each library.
    – Rajesh Pitty
    Nov 8 '12 at 10:13
















In log4j.xml you can configure log level for each library.
– Rajesh Pitty
Nov 8 '12 at 10:13




In log4j.xml you can configure log level for each library.
– Rajesh Pitty
Nov 8 '12 at 10:13












2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










In your logback.xml add an entry like this:



<logger name="com.typesafe.slick" level="INFO"/>


This means, that when a logger is obtained by any class of the namespace com.typesafe.slick it will have INFO set as log level.



edit: Here's the link to the documentation.






share|improve this answer





















  • Cool thanks. I did that and it works. I was just hoping it was possible to keep course grained logging inclusions/exclusions as part of the SBT setup to avoid spreading settings in different files. For example, in SBT you set the runlevel e.g. test, or runtime, and in the same fashion it would have been nice to just tell it to set the log level for a library.
    – Jack
    Nov 8 '12 at 11:06












  • I don't think that is possible. Setting the log level is runtime configuration, but sbt can only affect compile time. Also you have to have a logback.xml anyway, so I don't see the benefit of adding more stuff to the build file.
    – drexin
    Nov 8 '12 at 11:12










  • I suppose it depends on the way you use SBT. It's not uncommon to set the name and location of the logback.xml file as part of SBT config, which can be used to achieve the desired effect. I was just hoping to simplify my setup a little.
    – Jack
    Nov 8 '12 at 11:44






  • 4




    It's worth noting that as of today (16/1/13) the correct name is "scala.slick", rather than "com.typesafe.slick"
    – AlecZorab
    Jan 16 '13 at 17:11










  • Following AlecZorab's comments the name is no longer 'scala.slick' but just 'slick'
    – AlexC
    Nov 12 '15 at 11:11


















up vote
0
down vote













To see what name the logger of you dependency have you can use the standard logging appender in your logback.xml. So if you have the following:



<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
</encoder>
</appender>

<root level="info">
<appender-ref ref="STDOUT" />
</root>
</configuration>


You will get something like as a log message:




12:53:09 [AmexReporting-akka.stream.default-blocking-io-dispatcher-6]
INFO net.schmizz.sshj.connection.channel.direct.SessionChannel -
Will request sftp subsystem




Then you can add a logger between the appender and root level configuration:



<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
</encoder>
</appender>

<logger name="net.schmizz.sshj" level="OFF"/>

<root level="info">
<appender-ref ref="STDOUT" />
</root>
</configuration>


Where the logger name is a part or the full package name that you can see in the log output, depending on how granular you want your log settings to be.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13286656%2fhow-do-i-disable-logging-for-a-specific-dependency-in-sbt%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    In your logback.xml add an entry like this:



    <logger name="com.typesafe.slick" level="INFO"/>


    This means, that when a logger is obtained by any class of the namespace com.typesafe.slick it will have INFO set as log level.



    edit: Here's the link to the documentation.






    share|improve this answer





















    • Cool thanks. I did that and it works. I was just hoping it was possible to keep course grained logging inclusions/exclusions as part of the SBT setup to avoid spreading settings in different files. For example, in SBT you set the runlevel e.g. test, or runtime, and in the same fashion it would have been nice to just tell it to set the log level for a library.
      – Jack
      Nov 8 '12 at 11:06












    • I don't think that is possible. Setting the log level is runtime configuration, but sbt can only affect compile time. Also you have to have a logback.xml anyway, so I don't see the benefit of adding more stuff to the build file.
      – drexin
      Nov 8 '12 at 11:12










    • I suppose it depends on the way you use SBT. It's not uncommon to set the name and location of the logback.xml file as part of SBT config, which can be used to achieve the desired effect. I was just hoping to simplify my setup a little.
      – Jack
      Nov 8 '12 at 11:44






    • 4




      It's worth noting that as of today (16/1/13) the correct name is "scala.slick", rather than "com.typesafe.slick"
      – AlecZorab
      Jan 16 '13 at 17:11










    • Following AlecZorab's comments the name is no longer 'scala.slick' but just 'slick'
      – AlexC
      Nov 12 '15 at 11:11















    up vote
    5
    down vote



    accepted










    In your logback.xml add an entry like this:



    <logger name="com.typesafe.slick" level="INFO"/>


    This means, that when a logger is obtained by any class of the namespace com.typesafe.slick it will have INFO set as log level.



    edit: Here's the link to the documentation.






    share|improve this answer





















    • Cool thanks. I did that and it works. I was just hoping it was possible to keep course grained logging inclusions/exclusions as part of the SBT setup to avoid spreading settings in different files. For example, in SBT you set the runlevel e.g. test, or runtime, and in the same fashion it would have been nice to just tell it to set the log level for a library.
      – Jack
      Nov 8 '12 at 11:06












    • I don't think that is possible. Setting the log level is runtime configuration, but sbt can only affect compile time. Also you have to have a logback.xml anyway, so I don't see the benefit of adding more stuff to the build file.
      – drexin
      Nov 8 '12 at 11:12










    • I suppose it depends on the way you use SBT. It's not uncommon to set the name and location of the logback.xml file as part of SBT config, which can be used to achieve the desired effect. I was just hoping to simplify my setup a little.
      – Jack
      Nov 8 '12 at 11:44






    • 4




      It's worth noting that as of today (16/1/13) the correct name is "scala.slick", rather than "com.typesafe.slick"
      – AlecZorab
      Jan 16 '13 at 17:11










    • Following AlecZorab's comments the name is no longer 'scala.slick' but just 'slick'
      – AlexC
      Nov 12 '15 at 11:11













    up vote
    5
    down vote



    accepted







    up vote
    5
    down vote



    accepted






    In your logback.xml add an entry like this:



    <logger name="com.typesafe.slick" level="INFO"/>


    This means, that when a logger is obtained by any class of the namespace com.typesafe.slick it will have INFO set as log level.



    edit: Here's the link to the documentation.






    share|improve this answer












    In your logback.xml add an entry like this:



    <logger name="com.typesafe.slick" level="INFO"/>


    This means, that when a logger is obtained by any class of the namespace com.typesafe.slick it will have INFO set as log level.



    edit: Here's the link to the documentation.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 8 '12 at 10:45









    drexin

    21.5k35675




    21.5k35675












    • Cool thanks. I did that and it works. I was just hoping it was possible to keep course grained logging inclusions/exclusions as part of the SBT setup to avoid spreading settings in different files. For example, in SBT you set the runlevel e.g. test, or runtime, and in the same fashion it would have been nice to just tell it to set the log level for a library.
      – Jack
      Nov 8 '12 at 11:06












    • I don't think that is possible. Setting the log level is runtime configuration, but sbt can only affect compile time. Also you have to have a logback.xml anyway, so I don't see the benefit of adding more stuff to the build file.
      – drexin
      Nov 8 '12 at 11:12










    • I suppose it depends on the way you use SBT. It's not uncommon to set the name and location of the logback.xml file as part of SBT config, which can be used to achieve the desired effect. I was just hoping to simplify my setup a little.
      – Jack
      Nov 8 '12 at 11:44






    • 4




      It's worth noting that as of today (16/1/13) the correct name is "scala.slick", rather than "com.typesafe.slick"
      – AlecZorab
      Jan 16 '13 at 17:11










    • Following AlecZorab's comments the name is no longer 'scala.slick' but just 'slick'
      – AlexC
      Nov 12 '15 at 11:11


















    • Cool thanks. I did that and it works. I was just hoping it was possible to keep course grained logging inclusions/exclusions as part of the SBT setup to avoid spreading settings in different files. For example, in SBT you set the runlevel e.g. test, or runtime, and in the same fashion it would have been nice to just tell it to set the log level for a library.
      – Jack
      Nov 8 '12 at 11:06












    • I don't think that is possible. Setting the log level is runtime configuration, but sbt can only affect compile time. Also you have to have a logback.xml anyway, so I don't see the benefit of adding more stuff to the build file.
      – drexin
      Nov 8 '12 at 11:12










    • I suppose it depends on the way you use SBT. It's not uncommon to set the name and location of the logback.xml file as part of SBT config, which can be used to achieve the desired effect. I was just hoping to simplify my setup a little.
      – Jack
      Nov 8 '12 at 11:44






    • 4




      It's worth noting that as of today (16/1/13) the correct name is "scala.slick", rather than "com.typesafe.slick"
      – AlecZorab
      Jan 16 '13 at 17:11










    • Following AlecZorab's comments the name is no longer 'scala.slick' but just 'slick'
      – AlexC
      Nov 12 '15 at 11:11
















    Cool thanks. I did that and it works. I was just hoping it was possible to keep course grained logging inclusions/exclusions as part of the SBT setup to avoid spreading settings in different files. For example, in SBT you set the runlevel e.g. test, or runtime, and in the same fashion it would have been nice to just tell it to set the log level for a library.
    – Jack
    Nov 8 '12 at 11:06






    Cool thanks. I did that and it works. I was just hoping it was possible to keep course grained logging inclusions/exclusions as part of the SBT setup to avoid spreading settings in different files. For example, in SBT you set the runlevel e.g. test, or runtime, and in the same fashion it would have been nice to just tell it to set the log level for a library.
    – Jack
    Nov 8 '12 at 11:06














    I don't think that is possible. Setting the log level is runtime configuration, but sbt can only affect compile time. Also you have to have a logback.xml anyway, so I don't see the benefit of adding more stuff to the build file.
    – drexin
    Nov 8 '12 at 11:12




    I don't think that is possible. Setting the log level is runtime configuration, but sbt can only affect compile time. Also you have to have a logback.xml anyway, so I don't see the benefit of adding more stuff to the build file.
    – drexin
    Nov 8 '12 at 11:12












    I suppose it depends on the way you use SBT. It's not uncommon to set the name and location of the logback.xml file as part of SBT config, which can be used to achieve the desired effect. I was just hoping to simplify my setup a little.
    – Jack
    Nov 8 '12 at 11:44




    I suppose it depends on the way you use SBT. It's not uncommon to set the name and location of the logback.xml file as part of SBT config, which can be used to achieve the desired effect. I was just hoping to simplify my setup a little.
    – Jack
    Nov 8 '12 at 11:44




    4




    4




    It's worth noting that as of today (16/1/13) the correct name is "scala.slick", rather than "com.typesafe.slick"
    – AlecZorab
    Jan 16 '13 at 17:11




    It's worth noting that as of today (16/1/13) the correct name is "scala.slick", rather than "com.typesafe.slick"
    – AlecZorab
    Jan 16 '13 at 17:11












    Following AlecZorab's comments the name is no longer 'scala.slick' but just 'slick'
    – AlexC
    Nov 12 '15 at 11:11




    Following AlecZorab's comments the name is no longer 'scala.slick' but just 'slick'
    – AlexC
    Nov 12 '15 at 11:11












    up vote
    0
    down vote













    To see what name the logger of you dependency have you can use the standard logging appender in your logback.xml. So if you have the following:



    <configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
    <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
    </encoder>
    </appender>

    <root level="info">
    <appender-ref ref="STDOUT" />
    </root>
    </configuration>


    You will get something like as a log message:




    12:53:09 [AmexReporting-akka.stream.default-blocking-io-dispatcher-6]
    INFO net.schmizz.sshj.connection.channel.direct.SessionChannel -
    Will request sftp subsystem




    Then you can add a logger between the appender and root level configuration:



    <configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
    <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
    </encoder>
    </appender>

    <logger name="net.schmizz.sshj" level="OFF"/>

    <root level="info">
    <appender-ref ref="STDOUT" />
    </root>
    </configuration>


    Where the logger name is a part or the full package name that you can see in the log output, depending on how granular you want your log settings to be.






    share|improve this answer

























      up vote
      0
      down vote













      To see what name the logger of you dependency have you can use the standard logging appender in your logback.xml. So if you have the following:



      <configuration>
      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
      </encoder>
      </appender>

      <root level="info">
      <appender-ref ref="STDOUT" />
      </root>
      </configuration>


      You will get something like as a log message:




      12:53:09 [AmexReporting-akka.stream.default-blocking-io-dispatcher-6]
      INFO net.schmizz.sshj.connection.channel.direct.SessionChannel -
      Will request sftp subsystem




      Then you can add a logger between the appender and root level configuration:



      <configuration>
      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
      </encoder>
      </appender>

      <logger name="net.schmizz.sshj" level="OFF"/>

      <root level="info">
      <appender-ref ref="STDOUT" />
      </root>
      </configuration>


      Where the logger name is a part or the full package name that you can see in the log output, depending on how granular you want your log settings to be.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        To see what name the logger of you dependency have you can use the standard logging appender in your logback.xml. So if you have the following:



        <configuration>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
        <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
        </encoder>
        </appender>

        <root level="info">
        <appender-ref ref="STDOUT" />
        </root>
        </configuration>


        You will get something like as a log message:




        12:53:09 [AmexReporting-akka.stream.default-blocking-io-dispatcher-6]
        INFO net.schmizz.sshj.connection.channel.direct.SessionChannel -
        Will request sftp subsystem




        Then you can add a logger between the appender and root level configuration:



        <configuration>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
        <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
        </encoder>
        </appender>

        <logger name="net.schmizz.sshj" level="OFF"/>

        <root level="info">
        <appender-ref ref="STDOUT" />
        </root>
        </configuration>


        Where the logger name is a part or the full package name that you can see in the log output, depending on how granular you want your log settings to be.






        share|improve this answer












        To see what name the logger of you dependency have you can use the standard logging appender in your logback.xml. So if you have the following:



        <configuration>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
        <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
        </encoder>
        </appender>

        <root level="info">
        <appender-ref ref="STDOUT" />
        </root>
        </configuration>


        You will get something like as a log message:




        12:53:09 [AmexReporting-akka.stream.default-blocking-io-dispatcher-6]
        INFO net.schmizz.sshj.connection.channel.direct.SessionChannel -
        Will request sftp subsystem




        Then you can add a logger between the appender and root level configuration:



        <configuration>
        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
        <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{1000} - %msg%n</pattern>
        </encoder>
        </appender>

        <logger name="net.schmizz.sshj" level="OFF"/>

        <root level="info">
        <appender-ref ref="STDOUT" />
        </root>
        </configuration>


        Where the logger name is a part or the full package name that you can see in the log output, depending on how granular you want your log settings to be.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 at 11:58









        spydon

        2,63141944




        2,63141944






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13286656%2fhow-do-i-disable-logging-for-a-specific-dependency-in-sbt%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            What visual should I use to simply compare current year value vs last year in Power BI desktop

            Alexandru Averescu

            Trompette piccolo