Hi,
After attempting to have a flume log4j appender but couldn't make it work as
discussed as part of this thread..
http://karaf.922171.n3.nabble.com/Enabling-Flume-log4j-appender-logging-in-Karaf-td4036033.html#a4036041
and not knowing how to further debug the same.. thought of trying the
pax-logback-service followed by using the logback-flume appender and I have
done the configuration as documented for pax-logback-service -- still I
don't see the karaf.log populated..  The last thing I see in karaf.log is as
shown below and nothing else.. Please provide any knobs that I can turn on
to debug this in Karaf. I have included the configuration I did below.. 

---

Oct 22, 2014 10:32:46 AM org.apache.karaf.main.Main$KarafLockCallback
lockAquired
INFO: Lock acquired. Setting startlevel to 100


----

1. When I check pax-logback service status it shows  as Active as shown
below.. 

bundle:list |grep Logback
 8 | Active   |   8 | 1.7.2                                     | OPS4J Pax
Logging - Logback Service   

2. My org.ops4.pax.logging.cfg looks like this 

...
...
#    See the License for the specific language governing permissions and
#    limitations under the License.
#
################################################################################

org.ops4j.pax.logging.logback.config.file=${karaf.base}/etc/logback.xml


3. My logback.xml looks like this .. 

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -
%msg%n</pattern>
    </encoder>
  </appender>

  <appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
   
<file>/root/opt/distribution-karaf-0.2.0-SNAPSHOT/data/log/karaf.log</file>
    <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      
     
<fileNamePattern>/root/opt/distribution-karaf-0.2.0-SNAPSHOT/data/log/karaf.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
      <timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
        
        <maxFileSize>100MB</maxFileSize>
      </timeBasedFileNamingAndTriggeringPolicy>
      
      <maxHistory>30</maxHistory>
    </rollingPolicy>
    <append>true</append>
    
    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
      <layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
        <jsonFormatter
class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
          
          <prettyPrint>true</prettyPrint>
        </jsonFormatter>
        <context>api</context>
        <timestampFormat>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampFormat>
       <timestampFormatTimezoneId>UTC</timestampFormatTimezoneId>
        <appendLineSeparator>true</appendLineSeparator>
      </layout>
      
    </encoder>
  </appender>
  <root level="DEBUG">
    <appender-ref ref="STDOUT"/>
    <appender-ref ref="FILE"/>
  </root>

4. my etc/startup.properties looks like this... 

mvn\:org.codehaus.janino/com.springsource.org.codehaus.commons.compiler/2.6.1
= 8
mvn\:org.ops4j.pax.logging/pax-logging-logback/1.7.2 = 8
mvn\:org.ops4j.pax.logging/pax-logging-api/1.7.2 = 8
mvn\:org.ops4j.pax.logging/pax-logging-service/1.7.2 = 8












--
View this message in context: 
http://karaf.922171.n3.nabble.com/pax-logback-service-not-working-in-karaf-distribution-tp4036073.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to