users@glassfish.java.net

Re: Correct way to get domain logs path

From: Paulo Cesar Silva Reis <casmeiron_at_gmail.com>
Date: Thu, 19 Mar 2009 19:48:46 -0300

Hi Martin.

Thanks for the answer.

Yes, I was already using the log4j but when using log4j on glassfish it
doesnıt respect the log4.properties so Iıve decided to move to JDK Logging.

Maybe I wasnıt clear enough in my question (sorry) but Iım wondering how can
I get inside my app the path that glassfish use to generate the logs (this
value is provided by log-root attribute on domain.xml).

Or whether is possible to create a log-service entry on domain.xml informing
that all parent handlers will not log on the file (similar to call
java.util.Logger.setUseParentHandlers). And itıs possible to change the
level of my application logging (level per package) trough the Glassfish GUI
like it does to glassfish containers logging (web, ejb, server, etc.)?

Thanks.


On 3/19/09 7:33 PM, "Martin Gainty" <mgainty_at_hotmail.com> wrote:

> If you use Log4J you can establish a logger on the class or package
> and use that CLASSLOADER e.g.
> com.foo is package
> Bar is class of com.foo
> Logger barlogger = Logger.getLogger("com.foo.Bar");
>
> http://logging.apache.org/log4j/1.2/manual.html
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung / Disclaimer and confidentiality note
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich
> dem Austausch von Informationen und entfaltet keine rechtliche
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
> wir keine Haftung fuer den Inhalt uebernehmen.
> This message is confidential and may be privileged. If you are not the
> intended recipient, we kindly ask you to please inform the sender. Any
> unauthorised dissemination or copying hereof is prohibited. This message
> serves for information purposes only and shall not have any legally binding
> effect. Given that e-mails can easily be subject to manipulation, we can not
> accept any liability for the content provided.
>
>
>
>
>
>
>
> Date: Thu, 19 Mar 2009 18:59:16 -0300
> From: casmeiron_at_gmail.com
> To: users_at_glassfish.dev.java.net
> Subject: FW: Correct way to get domain logs path
>
> FW: Correct way to get domain logs path This is the correct way to ask this
> kind of question?
>
> Thanks.
> ------ Forwarded Message
> From: Paulo Cesar Silva Reis <casmeiron_at_gmail.com>
> Date: Thu, 19 Mar 2009 11:27:58 -0300
> To: "users_at_glassfish.dev.java.net" <users_at_glassfish.dev.java.net>
> Subject: Correct way to get domain logs path
>
> Hi,
> I am trying to get (inside an application deployed by ear file) the logs path
> (log-root attribute on domain.xml file) to create a personal log on that
> directory.
>
> The reason that I am using personal logs defined on application instead of
> domain.xml is that I couldnıt find a way to create a new log-service on
> domain.xml using something like Œuse-parent-handlers=falseı as I can do
> calling logger.setUseParentHandlers(false), I donıt want to have server logs
> on those files.
>
> Anyone knows how to do that? (both way)
>
> Thanks.
>
> ------ End of Forwarded Message
>
>
> Windows Live Contacts: Organize your contact list. Check it out.
> <http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cn
> s!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009>