[logback-user] About the file location in File appender

Klaus Teller klaus.teller at gmx.net
Tue Aug 18 03:18:45 CEST 2009


Good question. I don't know the details of the log4j implementation; so, I could only speculate. What about taking the location of the configuration file as the reference directory?

-------- Original-Nachricht --------
> Datum: Mon, 17 Aug 2009 17:52:10 -0700
> Von: Ralph Goers <rgoers at apache.org>
> An: logback users list <logback-user at qos.ch>
> Betreff: Re: [logback-user] About the file location in File appender

> How does a logging framework know that it is deployed in a webapp?  I  
> suppose Logback could if you were using a LoggerContext that indicated  
> that.
> 
> On Aug 17, 2009, at 4:44 PM, Klaus Teller wrote:
> 
> > That's new to me. I don't recall that log4j is interpreting relative  
> > paths this way.  In a web app for instance, I would take "relative"  
> > to mean relative to the deployment directory of the application.  
> > That is, if my app is deployed in ${TOMCAT_PATH}/webapps/myapp, a my  
> > log file my_log.txt would be located precisely in ${TOMCAT_PATH}/ 
> > webapps/myapp.
> >
> >
> >
> > -------- Original-Nachricht --------
> >> Datum: Mon, 17 Aug 2009 15:57:06 -0700
> >> Von: Ralph Goers <rgoers at apache.org>
> >> An: logback users list <logback-user at qos.ch>
> >> Betreff: Re: [logback-user] About the file location in File appender
> >
> >> Relative paths have to be relative to something. It is almost
> >> universal that they will be relative to the path that was the working
> >> directory at the time the application was started. So in this respect
> >> Logback is just being consistent.  How else would you expect it to
> >> behave?
> >>
> >> Ralph
> >>
> >> On Aug 17, 2009, at 3:47 PM, Klaus Teller wrote:
> >>
> >>> Hi,
> >>>
> >>> When i use the file appender and specify only the log file's name
> >>> (as opposed to absolute path), the log file is created in the
> >>> directory from which the application is started.
> >>>
> >>> For instance, if i start tomcat from the tomcat bin directory, the
> >>> log file is created right there in the bin directory. If i start
> >>> tomcat from my home directory, the log file will be created in my
> >>> home directory.
> >>>
> >>> Is this intentional? If so, can somebody help me understand the
> >>> rational?
> >>>
> >>> cheers,
> >>> Klaus.
> >>>
> >>> -- 
> >>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> >>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
> >>> _______________________________________________
> >>> Logback-user mailing list
> >>> Logback-user at qos.ch
> >>> http://qos.ch/mailman/listinfo/logback-user
> >>
> >> _______________________________________________
> >> Logback-user mailing list
> >> Logback-user at qos.ch
> >> http://qos.ch/mailman/listinfo/logback-user
> >
> > -- 
> > Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla  
> > Firefox 3 -
> > sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
> > _______________________________________________
> > Logback-user mailing list
> > Logback-user at qos.ch
> > http://qos.ch/mailman/listinfo/logback-user
> 
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


More information about the Logback-user mailing list