this is my log4j2.properties configuration
rootLogger = debug, FILE
appender.rolling.type = RollingFile
appender.rolling.name = FILE
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = [spark][%d{yy/MM/dd HH:mm:ss}] [%c] [%C] [%F] %p :: %m%n%ex
appender.rolling.filePattern = logs/log4j.prod.%d{yyyy-MM-dd-HH}.log.gz
appender.rolling.policies.type = Policies
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=100KB
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.fileName = logs/stdout.rca_nbo_rbal.prod.log
This is inside init_script that is triggered on cluster creation.
This is how i call it inside my class.With calling logger like this, will it inherit rootLogger?My rolling file is empty. I want to know which class is running, but i dont want to make logger for each class. I dont want to use getLogger(StaticLoggerName).
Why does this not inherit rootLogger?
log4j_logger = self.spark._jvm.org.apache.log4j # noqa
log4j_logger.LogManager.getLogger(self.__class__.__name__)
Main goal is that i want to know which class is running? I dont want to create static logger and just call it. Im using databricks clusters and pyspark.