mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lyor Goldstein (Jira)" <j...@apache.org>
Subject [jira] [Commented] (SSHD-1121) Logging with Mina SSHD
Date Thu, 21 Jan 2021 17:07:00 GMT

    [ https://issues.apache.org/jira/browse/SSHD-1121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17269445#comment-17269445
] 

Lyor Goldstein commented on SSHD-1121:
--------------------------------------

This is clearly a misconfiguration of the logging - please read the relevant documentation
for the slf4j adapter you are using (seems to be log4j in your case). We are using the slf4j
API and thus it is up to the +user+ to decide which adapter to use - our code is not involved
in this in any way. These adapters are pretty well documented and they require careful reading.
My guess is that you are placing the properties file in some non-default location and failing
to provide its correct location to the log4j adapter - read the relevant documentation and
figure this out. You can even debug the logging code and see what adapter it loads, and what
initialization this adapter does - specifically where it is looking for the configuration
file.

BTW: I think there is and error in using {{&LOG_DIR;}} - AFAIK this is not a valid "macro"
(but it has been some time since I used log4j so things may have changed). Again - read the
documentation carefully.

> Logging with Mina SSHD
> ----------------------
>
>                 Key: SSHD-1121
>                 URL: https://issues.apache.org/jira/browse/SSHD-1121
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: Susmit Sarkar
>            Priority: Major
>
> Need to have control over the default logging for customer issues debugging. Currently
using the below parameters in log4j.properties
> log4j.logger.org.apache.sshd=DEBUG
>  log4j.logger.org.apache.sshd.common.channel.Window=DEBUG
>  log4j.rootLogger=DEBUG,logfile
> log4j.appender.logfile=org.apache.log4j.RollingFileAppender
>  log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
>  log4j.appender.logfile.layout.ConversionPattern=%d\{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p
%c\{1} %x - %m%n
>  log4j.appender.logfile.File=&LOG_DIR;/sshdnativelogs.log
>  log4j.appender.logfile.Append=true
>  log4j.appender.logfile.MaxFileSize=1MB
>  log4j.appender.logfile.MaxBackupIndex=10
>   
>  But here the problem is nothing is getting written to the log file. But when I run the
application, in the console I am getting lots of logs, the same I need to get it print to
a log file, but with the above properties it is not working
>   
>  3671672 2021-01-21 20:00:42,951 [sshd-SftpSubsystem-thread-1] DEBUG org.apache.sshd.server.subsystem.sftp.SftpSubsystem
- resolveMissingFileAttributes(ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:59365])[/[permissions]]
replace null with [OWNER_READ, OWNER_WRITE, GROUP_READ, GROUP_WRITE, OTHERS_READ, OTHERS_WRITE]
>  3671672 2021-01-21 20:00:42,951 [sshd-SftpSubsystem-thread-1] DEBUG org.apache.sshd.server.session.ServerSessionImpl
- encode(ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:59365]) packet #11 sending command=94[SSH_MSG_CHANNEL_DATA]
len=261
>  3671751 2021-01-21 20:00:43,030 [NioProcessor-8] DEBUG org.apache.sshd.server.channel.ChannelSession
- handleData(ChannelSession[id=0, recipient=256]-ServerSessionImpl[admin@/0:0:0:0:0:0:0:1:59365])
SSH_MSG_CHANNEL_DATA len=14
>   
>  How will I have full control of enabling and disabling the logs as well apart from writing
to a log file?
>   
>  Any suggestions will be be highly helpful



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Mime
View raw message