Skip to content

Can't get SLF4J logging to work #22

@aelkayesh

Description

@aelkayesh

I am trying to get slf4j to work within the notebooks because some 3rd party libs that I use need it. When I try to set jshell classpath directly through --class-path it works. If I set IJAVA_CLASSPATH in kernel.json to point to the logging jars or when I import them in the notebook, it does not work, it says SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

%maven org.slf4j:slf4j-api:1.7.16
%maven ch.qos.logback:logback-classic:1.0.13    
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.impl.StaticLoggerBinder;

Logger slf4jLogger = LoggerFactory.getLogger("T");
slf4jLogger.warn("Hi, {}", "Test");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions