You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by conejo <lo...@gmail.com> on 2016/10/13 05:59:12 UTC

Log commands

Hi.
The command "log:tail" only show the rootLogger messages. Is there any way
to show messages of others logs?

I tried "log:display ALL" but no output was displayed



--
View this message in context: http://karaf.922171.n3.nabble.com/Log-commands-tp4048333.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Log commands

Posted by conejo <lo...@gmail.com>.
Now it works!
Many thanks!



--
View this message in context: http://karaf.922171.n3.nabble.com/Log-commands-tp4048333p4048344.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Log commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It's normal, the log:* commands uses the OSGi appender, not the file 
appender.

So, basically, your config should looks like:

log4j.rootLogger=INFO, out, osgi:*
log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer

log4j.logger.my.stuff=DEBUG, myappender, osgi:*

Regards
JB

On 10/13/2016 08:55 AM, conejo wrote:
> I have entries in the log file.
>
> I've configured my log:
> # YAROKI file appender
> log4j.appender.yaroki=org.apache.log4j.RollingFileAppender
> log4j.appender.yaroki.threshold=DEBUG
> log4j.appender.yaroki.layout=org.apache.log4j.PatternLayout
> log4j.appender.yaroki.layout.ConversionPattern=%d{ISO8601} | %-5.5p |
> %X{bundle.name} | %m%n
> log4j.appender.yaroki.file=${karaf.data}/log/yaroki.log
> log4j.appender.yaroki.append=true
> log4j.appender.yaroki.maxFileSize=100MB
> log4j.appender.yaroki.maxBackupIndex=10
>
> Anyway, I understand that if I write "log:tail ALL" should show at least the
> events seen in karaf.log, however if provoked events in karaf.log can see
> them but not in the console.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Log-commands-tp4048333p4048338.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Log commands

Posted by conejo <lo...@gmail.com>.
I have entries in the log file.

I've configured my log:
# YAROKI file appender
log4j.appender.yaroki=org.apache.log4j.RollingFileAppender
log4j.appender.yaroki.threshold=DEBUG
log4j.appender.yaroki.layout=org.apache.log4j.PatternLayout
log4j.appender.yaroki.layout.ConversionPattern=%d{ISO8601} | %-5.5p |
%X{bundle.name} | %m%n
log4j.appender.yaroki.file=${karaf.data}/log/yaroki.log
log4j.appender.yaroki.append=true
log4j.appender.yaroki.maxFileSize=100MB
log4j.appender.yaroki.maxBackupIndex=10

Anyway, I understand that if I write "log:tail ALL" should show at least the
events seen in karaf.log, however if provoked events in karaf.log can see
them but not in the console.



--
View this message in context: http://karaf.922171.n3.nabble.com/Log-commands-tp4048333p4048338.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Log commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Do you have message on this logger ?

log:tail will display only if you have messages/event on it.

More over, your config is not correct IMHO.

You should have:

log4j.logger.es.yaroki=INFO

for instance.

Regards
JB

On 10/13/2016 08:12 AM, conejo wrote:
> Hi JB, thanx but:
>
> karaf@root>log:list ALL
> Logger                              | Level
> -------------------------------------------
> ROOT                                | INFO
> es.yaroki               | ALL
> org.apache.karaf.jaas.modules.audit | INFO
>
> But when i write "log:tail es.yaroki" no output displayed.
> Not when i put "log:tail ALL".
>
> But in the karaf.log and in yaroki.log i can see new entries.
>
> My org.ops4j.pax.logging.cfg:
> # Root logger
> log4j.rootLogger = INFO, out, osgi:*
> log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer
>
> #Yaroki logger
> log4j.logger.es.yaroki=ALL, yaroki
> log4j.additivity.es.yaroki=false
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Log-commands-tp4048333p4048335.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Log commands

Posted by conejo <lo...@gmail.com>.
Hi JB, thanx but:

karaf@root>log:list ALL
Logger                              | Level
-------------------------------------------
ROOT                                | INFO
es.yaroki               | ALL
org.apache.karaf.jaas.modules.audit | INFO

But when i write "log:tail es.yaroki" no output displayed.
Not when i put "log:tail ALL".

But in the karaf.log and in yaroki.log i can see new entries.

My org.ops4j.pax.logging.cfg:
# Root logger
log4j.rootLogger = INFO, out, osgi:*
log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer

#Yaroki logger
log4j.logger.es.yaroki=ALL, yaroki
log4j.additivity.es.yaroki=false



--
View this message in context: http://karaf.922171.n3.nabble.com/Log-commands-tp4048333p4048335.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Log commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

you can provide the logger as argument:

log:tail org.apache.karaf.features.core

for instance (or any logger).

Same for log:display.

Regards
JB

On 10/13/2016 07:59 AM, conejo wrote:
> Hi.
> The command "log:tail" only show the rootLogger messages. Is there any way
> to show messages of others logs?
>
> I tried "log:display ALL" but no output was displayed
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Log-commands-tp4048333.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com