Hello! I'm trying to send function logs to our cen...
# general
d
Hello! I'm trying to send function logs to our central logging system, graylog. Typically, this is accomplished by providing a custom log4j2 xml file, but I don't see any way to do this at the function configuration level. I've tried modifying the
functions_log4j2.xml
file as mentioned here, but end up getting the following error just prior to my function starting up:
Copy code
2024-01-10 11:49:50,118 main ERROR Appenders contains an invalid element or attribute "Gelf"
2024-01-10 11:49:50,126 main ERROR Unable to locate appender "gelf" for logger config "root"
Which seems to indicate the logging system is not loading the gelf appender jar. Originally I merely had it included as a maven dependency inside my function jar, but then I reasoned that it appears that the logging system is starting before my function jar... and so maybe it does not have access to any of my function's dependencies.
Copy code
<dependency>
            <groupId>biz.paluch.logging</groupId>
            <artifactId>logstash-gelf</artifactId>
            <version>1.15.1</version>
        </dependency>
Then I manually placed the jar in my local standalone
/lib
directory just to see if that did anything. It did not. Log4j was still unable to recognize the gelf appender. Is there any recommendations on how best we can extract logging from our pulsar functions into our centralized graylog system? I'm thinking about perhaps trying to "manually" initialize a separate logging instance inside our functions with the gelf appender loaded on the classpath, but I'd really rather avoid even attempting that.