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

Dheeraj Panangat commented on FLINK-37919:
------------------------------------------

I also tried to use a custom logger SDK, with this logback
{code:java}
<configuration>
  <configurationListener class="io.gupshup.cx.LogbackInitListener"/>
</configuration> {code}
In the LogbackInitListener,
{code:java}
LoggerContext context = (LoggerContext)LoggerFactory.getILoggerFactory();
context.reset();
//--- initialise a custom logger{code}
The custom logger does not work either.

Additionally the jar containing io.gupshup.cx.LogbackInitListener, was added to 
/opt/flink/lib in the docker file.
{code:java}
FROM flink:1.20.1-j17
RUN mkdir -p $FLINK_HOME/usrlib
COPY target/logger-lib/cx-logger-*.jar $FLINK_HOME/lib/cx-logger.jar
COPY target/dummy-job-*.jar $FLINK_HOME/usrlib/flink-job.jar {code}

This did not work either.

 

> Logback | Not applied
> ---------------------
>
>                 Key: FLINK-37919
>                 URL: https://issues.apache.org/jira/browse/FLINK-37919
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Configuration
>    Affects Versions: 1.20.1
>            Reporter: Dheeraj Panangat
>            Priority: Major
>
> Below is the logback-console.xml being set in Flink :
> {code:java}
> <configuration debug="true" scan="true" scanPeriod="30 seconds">
>     <statusListener 
> class="ch.qos.logback.core.status.OnConsoleStatusListener"/>
>     <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
>         <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
>             <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level 
> %logger{36} - %msg%n</pattern>
>         </encoder>
>     </appender>
>     <logger name="io.company" level="INFO" additivity="false">
>         <appender-ref ref="CONSOLE"/>
>     </logger>
>     <logger name="com.company" level="INFO" additivity="false">
>         <appender-ref ref="CONSOLE"/>
>     </logger>
>     <root level="WARN">
>         <appender-ref ref="CONSOLE" />
>     </root>
> </configuration> {code}
> From within a package {{com.company.processor.DummyClass.class}}  I am 
> logging 2 statements,
> 1 with log.error() and other with log.info()
> Expecting both to be printed, but only see the ERROR log being printed.
> I have verified that the logback-console.xml is updated inside JM and TMs by 
> exec -it into the pods.
> The dummy class
> {code:java}
> package com.company.processor;
> import org.slf4j.Logger;
> import org.slf4j.LoggerFactory;
> public class DummyClass extends ProcessFunction<String, String> {
>  static final Logger log = LoggerFactory.getLogger(DummyClass.class);
>  //---inside processElement method : 
>  log.info("Accepted Data INFO: " + value);
>  log.error("Accepted Data ERROR:: {}", value);
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to