Hi Alex, [...] > Does the restlet engine attach a log handler?
No it doesn't, it just provides some support classes for the applications' access logging service (similar to Apache or IIS logging). There are some more explanations in the tutorial: http://www.restlet.org/documentation/1.0/tutorial#part07 > I turned on fine logs for > my code but it didn't show up until I attached my own > handler. Is there > a better way to control logging in restlet? Code-level logging is handle as any other JDK logging, you are free to choose your type of log handler and formatter. User access logging is handled in the same way but some helper classes are provided in NRE packages: - AccessLogFileHandler is a standard FileHandler that uses AccessLogFormatter as it's default formatter - AccessLogFormatter is a standard formatter that knows how to format a log record on a single line, with no prefix. - DefaultAccessLogFormatter is an AccessLogFormatter that prints a file header describing the default log format used by the LogService. I've added below the logging.properties file that I'm using for the Restlet Web site. I've also added a note to the Developer Guide RFE to add a section on logging configuration: http://restlet.tigris.org/issues/show_bug.cgi?id=21 Best regards, Jerome # ================================== # == == # == Web Logging Properties == # == == # ================================== # ------------------ # General properties # ------------------ # This defines a whitespace separated list of class names for handler classes to load and register as handlers on # the root Logger (the Logger named ""). Each class name must be for a Handler class which has a default constructor. # Note that these Handlers may be created lazily, when they are first used. handlers=java.util.logging.FileHandler # ------------------ # Loggers properties # ------------------ .level=WARNING org.mortbay.level=WARNING org.restlet.level=WARNING com.noelios.level=WARNING com.noelios.web.WebComponent.www.level=INFO com.noelios.web.WebComponent.www.handlers=com.noelios.restlet.util.AccessLog FileHandler com.noelios.web.WebComponent.www.useParentHandlers=false # ------------------------- # ConsoleHandler properties # ------------------------- # Specifies the default level for the Handler (defaults to Level.INFO). # java.util.logging.ConsoleHandler.level=WARNING # Specifies the name of a Filter class to use (defaults to no Filter). # java.util.logging.ConsoleHandler.filter= # Specifies the name of a Formatter class to use (defaults to java.util.logging.SimpleFormatter). # java.util.logging.ConsoleHandler.formatter= # The name of the character set encoding to use (defaults to the default platform encoding). # java.util.logging.ConsoleHandler.encoding= # ------------------------------ # General FileHandler properties # ------------------------------ # Specifies the default level for the Handler (defaults to Level.ALL). # java.util.logging.FileHandler.level=ALL # Specifies the name of a Filter class to use (defaults to no Filter). # java.util.logging.FileHandler.filter= # Specifies the name of a Formatter class to use (defaults to java.util.logging.XMLFormatter) java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter # The name of the character set encoding to use (defaults to the default platform encoding). # java.util.logging.FileHandler.encoding= # Specifies an approximate maximum amount to write (in bytes) to any one file. # If this is zero, then there is no limit. (Defaults to no limit). java.util.logging.FileHandler.limit=1000000 # Specifies how many output files to cycle through (defaults to 1). java.util.logging.FileHandler.count=20 # Specifies a pattern for generating the output file name. (Defaults to "%h/java%u.log"). # A pattern consists of a string that includes the following special components that will be replaced at runtime: # "/" the local pathname separator # "%t" the system temporary directory # "%h" the value of the "user.home" system property # "%g" the generation number to distinguish rotated logs # "%u" a unique number to resolve conflicts # "%%" translates to a single percent sign "%" java.util.logging.FileHandler.pattern=D:/Web/prod/data/log/WebComponent-app- %u-%g.log # Specifies whether the FileHandler should append onto any existing files (defaults to false). # java.util.logging.FileHandler.append= # ------------------------- # LogFileHandler properties # ------------------------- # Specifies the default level for the Handler (defaults to Level.ALL). # com.noelios.restlet.util.AccessLogFileHandler.level=ALL # Specifies the name of a Filter class to use (defaults to no Filter). # com.noelios.restlet.util.AccessLogFileHandler.filter= # Specifies the name of a Formatter class to use (defaults to java.util.logging.XMLFormatter) com.noelios.restlet.util.AccessLogFileHandler.formatter=com.noelios.restlet. util.DefaultAccessLogFormatter # The name of the character set encoding to use (defaults to the default platform encoding). # com.noelios.restlet.util.AccessLogFileHandler.encoding= # Specifies an approximate maximum amount to write (in bytes) to any one file. # If this is zero, then there is no limit. (Defaults to no limit). com.noelios.restlet.util.AccessLogFileHandler.limit=1000000 # Specifies how many output files to cycle through (defaults to 1). com.noelios.restlet.util.AccessLogFileHandler.count=20 # Specifies a pattern for generating the output file name. (Defaults to "%h/java%u.log"). # A pattern consists of a string that includes the following special components that will be replaced at runtime: # "/" the local pathname separator # "%t" the system temporary directory # "%h" the value of the "user.home" system property # "%g" the generation number to distinguish rotated logs # "%u" a unique number to resolve conflicts # "%%" translates to a single percent sign "%" com.noelios.restlet.util.AccessLogFileHandler.pattern=D:/Web/prod/data/log/W ebComponent-www-%u-%g.log # Specifies whether the AccessLogFileHandler should append onto any existing files (defaults to false). # com.noelios.restlet.util.AccessLogFileHandler.append=

