Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: JANSI-19
Type: IT Help Request IT Help Request
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Sean O'Callaghan
Reporter: usha kanteti
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Forge: Jansi

How to consider my own logger

Created: 20/May/10 02:57 PM   Updated: 03/Jun/10 08:45 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
Hi,
I configured my own logger log4j.properties file which is inside my bundle and in this configuration, I specied that all my bundle specific logging should go to MY_LOG.log and this log4j.properties file resides in src/main/resources folder.
        1. My Logger

###########################
log4j.appender.com.client=debug
log4j.rootLogger=DEBUG, MYLOG

log4j.logger.org.apache.camel=DEBUG

  1. Pattern to output the caller's file name and line number.
    log4j.appender.MYLOG.layout=org.apache.log4j.PatternLayout
    log4j.appender.MYLOG.layout.ConversionPattern =%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    log4j.appender.MYLOG = org.apache.log4j.DailyRollingFileAppender
    log4j.appender.MYLOG.File = MY_LOG.log
    log4j.appender.MYLOG.DatePattern='.'yyyy-MM-dd


    When I deployed my code in to FUSE ESB(apache servicemix), all my logging data is going into
    /apache_servicemix/data/log/karaf.log file and I don't find MY_LOG.log anywhere.

    and I see that /apache-servicemix/deploy folder has log4j.properties file which has the following content
    -----------------

    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
    log4j.rootLogger=DEBUG, stdout
    ~
    ~

Looks like FUSE ESB is not considering my logger.

I am wondering how we can specify to consider my logger rather than the default logger.

Thanks.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
usha kanteti added a comment - 20/May/10 04:53 PM
I realized that FUSE ESB's default logging comes from etc/org.ops4j.pax.logging.cfg configuration file.

If I configure etc/org.ops4j.pax.logging.cfg file, then that configuration applies to all the bundles deployed in that container.

Ideally I would like to specify different logging configuration for my bundle which should be different from other bundles.


Sean O'Callaghan added a comment - 03/Jun/10 08:45 AM
Hi,

Jansi is a small java library that allows you to use ANSI escape sequences in your Java console applications. It implements ANSI support on platforms which don't support it like Windows and provides graceful degradation for when output is being sent to output devices which cannot support ANSI sequences.

Please do not raise issues with respect to FUSE products under this project, it is not monitored by FUSE support.

Details on how to raise a support request are available here: http://fusesource.com/wiki/display/CUSTINFO/Jira+Instructions

With respect to logging, this cannot be set on a per bundle basis, the logging mechanism is underpinned by log4j so you can set logging on a per class basis.

I am now going to close this issue.

If you have any further queries please open a support request as per the instructions above.

Regards,

Seán O'Callaghan