[ 
https://issues.apache.org/jira/browse/SSHD-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Otto Frost updated SSHD-127:
----------------------------

    Description: 
Hello,

I need to have rolling logfiles. It isn't acceptable to have logfiles growing 
over a size limit.
What is the best way? Which log framework should be used?

Rolling when the log file reach a certain size would be the best, but rolling 
once an hour or once a day would suffice.

I want to use
org.apache.log4j.rolling.RollingFileAppender
but it needs  DOMConfigurator which is not possible with slf4j?

Stopping the server and roll the logfile using a script isn't a good solution.

*****************

It turned out to be  simple.

I'm using the slf4j-jdk14-1.5.2.jar
so standard java.util.logging

only thing to do
vm arguments:
-Djava.util.logging.config.file="C:\NWDS7.1EHP1\workspace\minasshd_custom\log.prop"

log.prop needs the following contents
#### Configuration File ####
# Global Params
# Handlers installed for the root logger
#handlers= java.util.logging.ConsoleHandler java.util.logging.FileHandler
handlers= java.util.logging.FileHandler
# Level for root logger—is used by any logger 
# that does not have its level set
.level= FINEST
# Initialization class—the public default constructor 
# of this class is called by the Logging framework
#config = ConfigureLogging

# Configure FileHandler
# Logging file name - %u specifies unique
# java.util.logging.FileHandler.pattern = java%g.log
java.util.logging.FileHandler.pattern = C:/sshd/log/java%g.log


# Write 100000 bytes before rotating this file
java.util.logging.FileHandler.limit = 1000
# Number of rotating files to be used
java.util.logging.FileHandler.count = 3
# Formatter to be used with this FileHandler
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter

# Configure ConsoleHandler
#java.util.logging.ConsoleHandler.level = FINEST
#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

# Set Logger Levels #
#com.level=SEVERE
#com.bruceeckel.level = FINEST
#com.bruceeckel.util.level = INFO
#com.bruceeckel.test.level = FINER
#random.level= SEVERE


Regards
Otto

  was:
Hello,

I need to have rolling logfiles. It isn't acceptable to have logfiles growing 
over a size limit.
What is the best way? Which log framework should be used?

Rolling when the log file reach a certain size would be the best, but rolling 
once an hour or once a day would suffice.

I want to use
org.apache.log4j.rolling.RollingFileAppender
but it needs  DOMConfigurator which is not possible with slf4j?

Stopping the server and roll the logfile using a script isn't a good solution.

Any help appreciated.

Regards
Otto


> rolling log files
> -----------------
>
>                 Key: SSHD-127
>                 URL: https://issues.apache.org/jira/browse/SSHD-127
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: Otto Frost
>
> Hello,
> I need to have rolling logfiles. It isn't acceptable to have logfiles growing 
> over a size limit.
> What is the best way? Which log framework should be used?
> Rolling when the log file reach a certain size would be the best, but rolling 
> once an hour or once a day would suffice.
> I want to use
> org.apache.log4j.rolling.RollingFileAppender
> but it needs  DOMConfigurator which is not possible with slf4j?
> Stopping the server and roll the logfile using a script isn't a good solution.
> *****************
> It turned out to be  simple.
> I'm using the slf4j-jdk14-1.5.2.jar
> so standard java.util.logging
> only thing to do
> vm arguments:
> -Djava.util.logging.config.file="C:\NWDS7.1EHP1\workspace\minasshd_custom\log.prop"
> log.prop needs the following contents
> #### Configuration File ####
> # Global Params
> # Handlers installed for the root logger
> #handlers= java.util.logging.ConsoleHandler java.util.logging.FileHandler
> handlers= java.util.logging.FileHandler
> # Level for root logger—is used by any logger 
> # that does not have its level set
> .level= FINEST
> # Initialization class—the public default constructor 
> # of this class is called by the Logging framework
> #config = ConfigureLogging
> # Configure FileHandler
> # Logging file name - %u specifies unique
> # java.util.logging.FileHandler.pattern = java%g.log
> java.util.logging.FileHandler.pattern = C:/sshd/log/java%g.log
> # Write 100000 bytes before rotating this file
> java.util.logging.FileHandler.limit = 1000
> # Number of rotating files to be used
> java.util.logging.FileHandler.count = 3
> # Formatter to be used with this FileHandler
> java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
> # Configure ConsoleHandler
> #java.util.logging.ConsoleHandler.level = FINEST
> #java.util.logging.ConsoleHandler.formatter = 
> java.util.logging.SimpleFormatter
> # Set Logger Levels #
> #com.level=SEVERE
> #com.bruceeckel.level = FINEST
> #com.bruceeckel.util.level = INFO
> #com.bruceeckel.test.level = FINER
> #random.level= SEVERE
> Regards
> Otto

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to