Simplest Java sample; Simplest logback.xml; what no logfile

Single barebones Java file using slf4j package - 2 imports; Default package. barebones logbackxml - directly under classpath - which is 'current directory'. The log statements in file seen on console, but no FileAppender (file) created. Messing with logback.xml syntax makes no difference - means it is simply not read by the program. I can use help. This is my first trial with logback; only used log4j a while back. no groovy or maven nothing. plain command line javac and java. Java: import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class NMSLogger { private final Logger nmsLogger = LoggerFactory.getLogger(NMSLogger.class); public void sayHello(String name) { nmsLogger.info("INFO: Hi, {}", name); nmsLogger.info("INFO:Welcome to the NBN NMS LogBack World. Hello World!\n"); nmsLogger.error("EROR:Welcome to the NBN NMS LogBack World. Hello World!\n"); } public static void main(String[] args) { NMSLogger theLogger = new NMSLogger(); theLogger.sayHello("srccodes.com"); } } ------------- logback.xml: <configuration> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>logFile.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern> logFile.%d{yyyy-MM-dd}.log.zip </FileNamePatter> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> %d{HH:mm:ss,SSS} [%thread] %-5level %logger{22} - %msg%n </Pattern> </layout> <root level="${root-level:-debug}"> <appender-ref ref="FILE"/> </root> </appender> </configuration> ----------- dir: logback.xml NMSLogger.class NMSLogger.java slf4j-api-1.7.5.jar* slf4j-jdk14-1.7.5.jar ========== Any help, pointers please? -- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com.

Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things. But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan -- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com.

Hi Kundan, As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console. Thanks, Ajay -----Original Message----- From: Logback-user [mailto:logback-user-bounces@qos.ch] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: logback-user@qos.ch Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things. But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan -- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS***

Ajay, Rhanks dir a quick response. I started on eclipse; but as I started to strip down the complexity, I moved to command line, removed ANT, other files etc. the result - running the program on the cmd window, and console output of the messages which I have included in the single java file (attached-3messages). Nothing else, no errors, and no message regarding 'file log back.xml not found', or invalid syntax, or exception trace ... nothing. Plain successful execution of program with console logging as if logback.xml doesn't exist! Thanks Kundan On Jun 26, 2013, at 2:53 AM, "Ajaykumar Ashokkumar Lavhade [via Logback]"<ml-node+s10977n12586h30@n7.nabble.com> wrote:
Hi Kundan,
As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console.
Thanks, Ajay
-----Original Message----- From: Logback-user [mailto:[hidden email]] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: [hidden email] Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile
Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things.
But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan
-- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ Logback-user mailing list [hidden email] http://mailman.qos.ch/mailman/listinfo/logback-user
**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** _______________________________________________ Logback-user mailing list [hidden email] http://mailman.qos.ch/mailman/listinfo/logback-user
If you reply to this email, your message will be added to the discussion below: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML
-- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com.

Unless your original e-mail omitted some information, it doesn't look like you have the logback JARs on your classpath. On Wed, Jun 26, 2013 at 3:17 AM, Kundan Bapat <kundan.bapat@gmail.com>wrote:
Ajay,
Rhanks dir a quick response.
I started on eclipse; but as I started to strip down the complexity, I moved to command line, removed ANT, other files etc. the result - running the program on the cmd window, and console output of the messages which I have included in the single java file (attached-3messages). Nothing else, no errors, and no message regarding 'file log back.xml not found', or invalid syntax, or exception trace ... nothing. Plain successful execution of program with console logging as if logback.xml doesn't exist!
Thanks Kundan
On Jun 26, 2013, at 2:53 AM, "Ajaykumar Ashokkumar Lavhade [via Logback]"<[hidden email] <http://user/SendEmail.jtp?type=node&node=12587&i=0>> wrote:
Hi Kundan,
As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console.
Thanks, Ajay
-----Original Message----- From: Logback-user [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=12586&i=0>] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=1> Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile
Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things.
But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan
-- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=3> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12587.html>
Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

hmm... I though the slf4j code is a wrapper around logback? And if I do not have the logback jar files how did the program still run? does it mean that some of the slf4j code look for logback classes, and if not found, degrades gracefully by 'not bothering to look for logback.xml, and just do the console logging? Thank you Kundan. On Wed, Jun 26, 2013 at 9:16 PM, Abraham Lin [via Logback] < ml-node+s10977n12593h47@n7.nabble.com> wrote:
Unless your original e-mail omitted some information, it doesn't look like you have the logback JARs on your classpath.
On Wed, Jun 26, 2013 at 3:17 AM, Kundan Bapat <[hidden email]<http://user/SendEmail.jtp?type=node&node=12593&i=0>
wrote:
Ajay,
Rhanks dir a quick response.
I started on eclipse; but as I started to strip down the complexity, I moved to command line, removed ANT, other files etc. the result - running the program on the cmd window, and console output of the messages which I have included in the single java file (attached-3messages). Nothing else, no errors, and no message regarding 'file log back.xml not found', or invalid syntax, or exception trace ... nothing. Plain successful execution of program with console logging as if logback.xml doesn't exist!
Thanks Kundan
On Jun 26, 2013, at 2:53 AM, "Ajaykumar Ashokkumar Lavhade [via Logback]"<[hidden email] <http://user/SendEmail.jtp?type=node&node=12587&i=0>> wrote:
Hi Kundan,
As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console.
Thanks, Ajay
-----Original Message----- From: Logback-user [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=12586&i=0>] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=1> Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile
Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things.
But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan
-- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=3> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12587.html>
Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=1> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=12583&code=a3VuZGFuLmJhcGF0QGdtYWlsLmNvbXwxMjU4M3wxNTMwODkyNTY=> . NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- Sincerely, Kundan There never was a truly great man who was not at the same time truly virtuous. Humility | Sincerity | Temperance | Resolution | Industry | Justice - *Ben Franklin* -- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com.

The SLF4J library is just an API that expects an implementation (not necessarily logback) to be bound at runtime. See the documentation: http://www.slf4j.org/manual.html. It also looks like you've provided the JDK logging binding, so your code is using that instead of the fallback NOP logger. Your program has no dependencies on logback APIs, so there's no reason why it wouldn't work. On Wed, Jun 26, 2013 at 11:49 PM, Kundan Bapat <kundan.bapat@gmail.com>wrote:
hmm... I though the slf4j code is a wrapper around logback? And if I do not have the logback jar files how did the program still run? does it mean that some of the slf4j code look for logback classes, and if not found, degrades gracefully by 'not bothering to look for logback.xml, and just do the console logging?
Thank you Kundan.
On Wed, Jun 26, 2013 at 9:16 PM, Abraham Lin [via Logback] <[hidden email]<http://user/SendEmail.jtp?type=node&node=12595&i=0>
wrote:
Unless your original e-mail omitted some information, it doesn't look like you have the logback JARs on your classpath.
On Wed, Jun 26, 2013 at 3:17 AM, Kundan Bapat <[hidden email]<http://user/SendEmail.jtp?type=node&node=12593&i=0>
wrote:
Ajay,
Rhanks dir a quick response.
I started on eclipse; but as I started to strip down the complexity, I moved to command line, removed ANT, other files etc. the result - running the program on the cmd window, and console output of the messages which I have included in the single java file (attached-3messages). Nothing else, no errors, and no message regarding 'file log back.xml not found', or invalid syntax, or exception trace ... nothing. Plain successful execution of program with console logging as if logback.xml doesn't exist!
Thanks Kundan
On Jun 26, 2013, at 2:53 AM, "Ajaykumar Ashokkumar Lavhade [via Logback]"<[hidden email]<http://user/SendEmail.jtp?type=node&node=12587&i=0>> wrote:
Hi Kundan,
As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console.
Thanks, Ajay
-----Original Message----- From: Logback-user [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=12586&i=0>] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=1> Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile
Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things.
But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan
-- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=3> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12587.html>
Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=1> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- Sincerely, Kundan
There never was a truly great man who was not at the same time truly virtuous. Humility | Sincerity | Temperance | Resolution | Industry | Justice
- *Ben Franklin*
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12595.html> Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Thanks Abraham! No shorts cuts:) I was hoping to do a quick working sample.. since logback is claimed to be a simple (yet powerful) extension of log4j. Thanks, I guess no alternative to reading the man pages. You mentioned one thing below: "you've provided the JDK logging binding / so code uses that instead of the fallback NOP logger": - Am assuming NOP is No Operation logger? - Where did I provide the JDK logging bindings - haven't imported any Java Logging packages. - While I will read the doc (saw it before, but resisted:) ) - with the given code + logback.xml + jars, if I include logback.jar(s) things should just 'work'... or I will need to update code in some ways to 'make it use the logback' Thanks, Kundan On Thu, Jun 27, 2013 at 12:14 AM, Abraham Lin [via Logback] < ml-node+s10977n12597h71@n7.nabble.com> wrote:
The SLF4J library is just an API that expects an implementation (not necessarily logback) to be bound at runtime. See the documentation: http://www.slf4j.org/manual.html. It also looks like you've provided the JDK logging binding, so your code is using that instead of the fallback NOP logger.
Your program has no dependencies on logback APIs, so there's no reason why it wouldn't work.
On Wed, Jun 26, 2013 at 11:49 PM, Kundan Bapat <[hidden email]<http://user/SendEmail.jtp?type=node&node=12597&i=0>
wrote:
hmm... I though the slf4j code is a wrapper around logback? And if I do not have the logback jar files how did the program still run? does it mean that some of the slf4j code look for logback classes, and if not found, degrades gracefully by 'not bothering to look for logback.xml, and just do the console logging?
Thank you Kundan.
On Wed, Jun 26, 2013 at 9:16 PM, Abraham Lin [via Logback] <[hidden email] <http://user/SendEmail.jtp?type=node&node=12595&i=0>> wrote:
Unless your original e-mail omitted some information, it doesn't look like you have the logback JARs on your classpath.
On Wed, Jun 26, 2013 at 3:17 AM, Kundan Bapat <[hidden email]<http://user/SendEmail.jtp?type=node&node=12593&i=0>
wrote:
Ajay,
Rhanks dir a quick response.
I started on eclipse; but as I started to strip down the complexity, I moved to command line, removed ANT, other files etc. the result - running the program on the cmd window, and console output of the messages which I have included in the single java file (attached-3messages). Nothing else, no errors, and no message regarding 'file log back.xml not found', or invalid syntax, or exception trace ... nothing. Plain successful execution of program with console logging as if logback.xml doesn't exist!
Thanks Kundan
On Jun 26, 2013, at 2:53 AM, "Ajaykumar Ashokkumar Lavhade [via Logback]"<[hidden email]<http://user/SendEmail.jtp?type=node&node=12587&i=0>> wrote:
Hi Kundan,
As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console.
Thanks, Ajay
-----Original Message----- From: Logback-user [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=12586&i=0>] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=1> Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile
Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things.
But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan
-- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=3> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12587.html>
Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=1> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- Sincerely, Kundan
There never was a truly great man who was not at the same time truly virtuous. Humility | Sincerity | Temperance | Resolution | Industry | Justice
- *Ben Franklin*
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12595.html> Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12597&i=1> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12597&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=12583&code=a3VuZGFuLmJhcGF0QGdtYWlsLmNvbXwxMjU4M3wxNTMwODkyNTY=> . NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- Sincerely, Kundan There never was a truly great man who was not at the same time truly virtuous. Humility | Sincerity | Temperance | Resolution | Industry | Justice - *Ben Franklin* -- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com.

- Am assuming NOP is No Operation logger?
Yes.
- Where did I provide the JDK logging bindings - haven't imported any Java Logging packages.
You have slf4j-jdk14-1.7.5.jar on your classpath.
- While I will read the doc (saw it before, but resisted:) ) - with the given code + logback.xml + jars, if I include logback.jar(s) things should just 'work'... or I will need to update code in some ways to 'make it use the logback'
Yes, add the logback JARs and remove the JDK logging binding; no code changes should be necessary.
Thanks, Kundan
On Thu, Jun 27, 2013 at 12:14 AM, Abraham Lin [via Logback] <[hidden email] <http://user/SendEmail.jtp?type=node&node=12599&i=0>> wrote:
The SLF4J library is just an API that expects an implementation (not necessarily logback) to be bound at runtime. See the documentation: http://www.slf4j.org/manual.html. It also looks like you've provided the JDK logging binding, so your code is using that instead of the fallback NOP logger.
Your program has no dependencies on logback APIs, so there's no reason why it wouldn't work.
On Wed, Jun 26, 2013 at 11:49 PM, Kundan Bapat <[hidden email]<http://user/SendEmail.jtp?type=node&node=12597&i=0>
wrote:
hmm... I though the slf4j code is a wrapper around logback? And if I do not have the logback jar files how did the program still run? does it mean that some of the slf4j code look for logback classes, and if not found, degrades gracefully by 'not bothering to look for logback.xml, and just do the console logging?
Thank you Kundan.
On Wed, Jun 26, 2013 at 9:16 PM, Abraham Lin [via Logback] <[hidden email] <http://user/SendEmail.jtp?type=node&node=12595&i=0>> wrote:
Unless your original e-mail omitted some information, it doesn't look like you have the logback JARs on your classpath.
On Wed, Jun 26, 2013 at 3:17 AM, Kundan Bapat <[hidden email]<http://user/SendEmail.jtp?type=node&node=12593&i=0>
wrote:
Ajay,
Rhanks dir a quick response.
I started on eclipse; but as I started to strip down the complexity, I moved to command line, removed ANT, other files etc. the result - running the program on the cmd window, and console output of the messages which I have included in the single java file (attached-3messages). Nothing else, no errors, and no message regarding 'file log back.xml not found', or invalid syntax, or exception trace ... nothing. Plain successful execution of program with console logging as if logback.xml doesn't exist!
Thanks Kundan
On Jun 26, 2013, at 2:53 AM, "Ajaykumar Ashokkumar Lavhade [via Logback]"<[hidden email]<http://user/SendEmail.jtp?type=node&node=12587&i=0>> wrote:
Hi Kundan,
As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console.
Thanks, Ajay
-----Original Message----- From: Logback-user [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=12586&i=0>] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: [hidden email]<http://user/SendEmail.jtp?type=node&node=12586&i=1> Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile
Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things.
But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan
-- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** _______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12586&i=3> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12587.html>
Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=1> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12593&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- Sincerely, Kundan
There never was a truly great man who was not at the same time truly virtuous. Humility | Sincerity | Temperance | Resolution | Industry | Justice
- *Ben Franklin*
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12595.html> Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12597&i=1> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=12597&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
-- Sincerely, Kundan
There never was a truly great man who was not at the same time truly virtuous. Humility | Sincerity | Temperance | Resolution | Industry | Justice
- *Ben Franklin*
------------------------------ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12599.html> Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html>at Nabble.com.
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Make sure the logback.xml configuration file is in the classpath src/main/resources. From: Logback-user [mailto:logback-user-bounces@qos.ch] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 12:48 PM To: logback-user@qos.ch Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile Ajay, Rhanks dir a quick response. I started on eclipse; but as I started to strip down the complexity, I moved to command line, removed ANT, other files etc. the result - running the program on the cmd window, and console output of the messages which I have included in the single java file (attached-3messages). Nothing else, no errors, and no message regarding 'file log back.xml not found', or invalid syntax, or exception trace ... nothing. Plain successful execution of program with console logging as if logback.xml doesn't exist! Thanks Kundan On Jun 26, 2013, at 2:53 AM, "Ajaykumar Ashokkumar Lavhade [via Logback]"<[hidden email]</user/SendEmail.jtp?type=node&node=12587&i=0>> wrote: Hi Kundan, As per your logback.xml settings logFile.log will get created in your project directory. If you are using eclipse and you are not able to view your logFile.log in your project directory then please do refresh it. If this doesn't work then post the entire message you gets on console. Thanks, Ajay -----Original Message----- From: Logback-user [mailto:[hidden email]</user/SendEmail.jtp?type=node&node=12586&i=0>] On Behalf Of Kundan Bapat Sent: Wednesday, June 26, 2013 11:37 AM To: [hidden email]</user/SendEmail.jtp?type=node&node=12586&i=1> Subject: Re: [logback-user] Simplest Java sample; Simplest logback.xml; what no logfile Just noticed some syntax errors in logback.xml, as I was meddling with it, trying different things. But as mentioned in previous post, it doesn't matter because the logback.xml file is simply 'not read in' when the Java class is executed. Thanks Kundan -- View this message in context: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... Sent from the Users mailing list archive at Nabble.com<http://Nabble.com>. _______________________________________________ Logback-user mailing list [hidden email]</user/SendEmail.jtp?type=node&node=12586&i=2> http://mailman.qos.ch/mailman/listinfo/logback-user **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** _______________________________________________ Logback-user mailing list [hidden email]</user/SendEmail.jtp?type=node&node=12586&i=3> http://mailman.qos.ch/mailman/listinfo/logback-user ________________________________ If you reply to this email, your message will be added to the discussion below: http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml... To unsubscribe from Simplest Java sample; Simplest logback.xml; what no logfile, click here. NAML<http://logback.10977.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> ________________________________ View this message in context: Re: Simplest Java sample; Simplest logback.xml; what no logfile<http://logback.10977.n7.nabble.com/Simplest-Java-sample-Simplest-logback-xml-what-no-logfile-tp12583p12587.html> Sent from the Users mailing list archive<http://logback.10977.n7.nabble.com/Users-f3.html> at Nabble.com.
participants (3)
-
Abraham Lin
-
Ajaykumar Ashokkumar Lavhade
-
Kundan Bapat