Skip to main content



      Home
Home » Eclipse Projects » e(fx)clipse » logging with custom handlers(org.eclipse.fx.core logging)
logging with custom handlers [message #1698029] Wed, 10 June 2015 09:31 Go to next message
Eclipse UserFriend
Hi!
I was just trying to customize some logging handlers and setting up @properties. e.g
# Logging
handlers = java.util.logging.FileHandler, myapp.MyCustomConsoleHandler
.level = DEBUG

# File Logging
java.util.logging.FileHandler.pattern = ./myApp.log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = DEBUG

# Console Logging
java.util.logging.ConsoleHandler.level = DEBUG


Of course, that does not work due to class loading issue as I'm working with OSGI. I thought at first may be a fragment from package org.eclipse.fx.core would solve the problem but it doesn't. Something like

# Logging
handlers = java.util.logging.FileHandler, org.eclipse.fx.core.log.MyCustomConsoleHandler
.level = DEBUG

# File Logging
java.util.logging.FileHandler.pattern = ./myApp.log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = DEBUG

# Console Logging
java.util.logging.ConsoleHandler.level = DEBUG


Where this class org.eclipse.fx.core.log.MyCustomConsoleHandler is defined in a fragment of org.eclipse.fx.core
But it doesn't work neither.


What could be a good way to go here? Perhaps registering the handler from a service or something? or What might I be missing?

Thanks!
Br
Pablo

[Updated on: Wed, 10 June 2015 09:31] by Moderator

Re: logging with custom handlers [message #1698067 is a reply to message #1698029] Wed, 10 June 2015 14:45 Go to previous messageGo to next message
Eclipse UserFriend
The Problem most likely is that java.util.Logger tries to load the class but because it isn't on any classpath visible the base classloaders this must fail - please file a bug so that we allow to register handlers through osgi
Re: logging with custom handlers [message #1698097 is a reply to message #1698067] Thu, 11 June 2015 04:18 Go to previous message
Eclipse UserFriend
Thanks Tom!
I filed it up as an enhancement: https://bugs.eclipse.org/bugs/show_bug.cgi?id=469907
Previous Topic:Detaching views using DnD
Next Topic:@PreClose in PartDescriptor
Goto Forum:
  


Current Time: Sat Jul 05 09:35:15 EDT 2025

Powered by FUDForum. Page generated in 0.42910 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top