Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / November 2004

Tip: Looking for answers? Try searching our database.

Java Logging API problems

Thread view: 
Simor - 23 Nov 2004 17:23 GMT
Hi,
i try to use the java logging api in my project. But there is a
problem, maybe somebody can help me:

I don't want the standard configuration for the logger from the
/lib/logging.properties. I want the LogManger to read and follow my
own configuration file. So i set the java propertie
"java.util.logging.config.file", like this:
System.setProperty("java.util.logging.config.file",System.getProperty("user.dir")
+ System.getProperty("file.seperator") + "customproperties");

before i create my LogManager like this:
LM = LogManager.getLogManager();

But it doesn't work. If got no errormsg, but changes in the
configuration file doesn't have any effect on application logging
behavior.

THX
Simor

P.S. I use eclipse 3.1 M2.
Robert Klemme - 24 Nov 2004 10:17 GMT
> Hi,
> i try to use the java logging api in my project. But there is a
[quoted text clipped - 4 lines]
> own configuration file. So i set the java propertie
> "java.util.logging.config.file", like this:

System.setProperty("java.util.logging.config.file",System.getProperty("use
r.dir")
> + System.getProperty("file.seperator") + "customproperties");
>
[quoted text clipped - 9 lines]
>
> P.S. I use eclipse 3.1 M2.

Did you try setting the property on VM start via
"-Djava.util.logging.config.file=your_file_name"?  Did it make a
difference?

   robert
Simor - 25 Nov 2004 10:30 GMT
> Did you try setting the property on VM start via
> "-Djava.util.logging.config.file=your_file_name"?  Did it make a
> difference?
>
>     robert

Thanks for the hint, it works. But is there any way to set this
proberty within my source code, not as parameter for the VM start?
Robert Klemme - 25 Nov 2004 13:04 GMT
> > Did you try setting the property on VM start via
> > "-Djava.util.logging.config.file=your_file_name"?  Did it make a
[quoted text clipped - 4 lines]
> Thanks for the hint, it works. But is there any way to set this
> proberty within my source code, not as parameter for the VM start?

AFAIK these properties are meant to be set on the command line and not
from inside the VM.  You might have to resort to another mechanism.

Kind regards

   robert
Xavier Tarrago - 26 Nov 2004 08:25 GMT
What about
System.setProperty("java.util.logging.config.file",
"my/logging/file/logging");

> > "Robert Klemme" <bob.news@gmx.net> wrote in message
> news:<30j5eiF30q72oU1@uni-berlin.de>...
[quoted text clipped - 14 lines]
>
>     robert
Robert Klemme - 26 Nov 2004 09:56 GMT
> What about
> System.setProperty("java.util.logging.config.file",
> "my/logging/file/logging");

That didn't work (see the OP's original post).  Probably it was too late.

   robert

> > > "Robert Klemme" <bob.news@gmx.net> wrote in message
> > news:<30j5eiF30q72oU1@uni-berlin.de>...
[quoted text clipped - 14 lines]
> >
> >     robert


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.