IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » log4j The latest public log4j snipts.

showing 1-3 of 3 snipts for log4j
  • log4j sample configuration
    ### direct log messages to stdout ###
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    
    ### direct messages to file hibernate.log ###
    #log4j.appender.file=org.apache.log4j.FileAppender
    #log4j.appender.file.File=hibernate.log
    #log4j.appender.file.layout=org.apache.log4j.PatternLayout
    #log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    
    ### set log levels - for more verbose logging change 'info' to 'debug' ###
    
    log4j.rootLogger=warn, stdout
    
    #log4j.logger.org.hibernate=info
    #log4j.logger.org.hibernate=debug
    
    ### log HQL query parser activity
    #log4j.logger.org.hibernate.hql.ast.AST=debug
    
    ### log just the SQL
    #log4j.logger.org.hibernate.SQL=debug
    
    ### log JDBC bind parameters ###
    #log4j.logger.org.hibernate.type=info
    #log4j.logger.org.hibernate.type=debug
    
    ### log schema export/update ###
    #log4j.logger.org.hibernate.tool.hbm2ddl=debug
    
    ### log HQL parse trees
    #log4j.logger.org.hibernate.hql=debug
    
    ### log cache activity ###
    #log4j.logger.org.hibernate.cache=debug
    
    ### log transaction activity
    #log4j.logger.org.hibernate.transaction=debug
    
    ### log JDBC resource acquisition
    #log4j.logger.org.hibernate.jdbc=debug
    
    ### enable the following line if you want to track down connection ###
    ### leakages when using DriverManagerConnectionProvider ###
    #log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
    

    copy | embed

    0 comments - tagged in  posted by Titan on Jul 20, 2010 at 8:46 a.m. EDT
  • Getting a logger with Log4j
    private static final Log LOG = LogFactory.getLog(SomeClassName.class);
    

    copy | embed

    0 comments - tagged in  posted by lenni on Feb 09, 2010 at 4:43 a.m. EST
  • arquivo de propriedade do log4j
    # Configura dois appenders (stdout para o console, fileout para um arquivo)
    # para o logger padrão, e configura um nível (INFO). Como todos os
    # loggers que criamos herdam do logger padrãoo, quaisquer loggers que criarmos
    # terão esta configuração
    log4j.rootCategory=INFO, stdout, fileout
    # O primeiro appender escreve para o console
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    # O padrão para apresentação do conteúdo (layout)
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
    # O segundo appender escreve para um arquivo
    log4j.appender.fileout=org.apache.log4j.RollingFileAppender
    log4j.appender.fileout.File=exemplo.log
    # Controla o tamanho máximo do arquivo de log
    log4j.appender.fileout.MaxFileSize=500KB
    # Arquiva arquivos de log (somente um arquivo de backup)
    log4j.appender.fileout.MaxBackupIndex=1
    # O padrãoo para apresentação do conteúdo (layout)
    log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
    log4j.appender.fileout.layout.ConversionPattern=(%F:%L) %p %t %c - %m%n
    

    copy | embed

    0 comments - tagged in  posted by mwanalezi on Nov 16, 2009 at 9:00 p.m. EST
Sign up to create your own snipts, or login.