Lucee log4j and org.owasp.esapi.devteam error - lucee

I am trying to log several variables in lucee 5.2.9 (jdk 1.8) via cfdump var= "#variable#" output="console", but unfortunately I get the following error stack in log file. Lucee has been installed via commandbox (start command) as embedded server.
[ERROR] runwar.context: log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.PoolingHttpClientConnectionManager).
[ERROR] runwar.context: log4j:WARN Please initialize the log4j system properly.
[ERROR] runwar.context: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[ERROR] runwar.context: System property [org.owasp.esapi.opsteam] is not set
[ERROR] runwar.context: System property [org.owasp.esapi.devteam] is not set
Any idea what could I do?

Related

log4j-1.2-api bridge ClassNotFoundException:org.apache.log4j.RollingFileAppender

I try to migrate my application from log4j to log4j2. According to official manual I have org.apache.logging.log4j:log4j-1.2-api:2.17.1, org.apache.logging.log4j:log4j-api:2.17.1 and org.apache.logging.log4j:log4j-core:2.17.1 in my maven dependencies. I use log4j.properties file so I enabled compatibility mode (-Dlog4j1.compatibility=true). RollingFileAppender is configured in my log4j.properties file:
log4j.appender.A2=org.apache.log4j.RollingFileAppender
I get following error:
2022-02-16 21:04:20,396 main ERROR Unable to create Appender org.apache.log4j.RollingFileAppender due to ClassNotFoundException:org.apache.log4j.RollingFileAppender
According to official manual, RollingFileAppender is a supported component. I had log4j:log4j:1.2.17 dependency before migration to log4j2 and it contains org.apache.log4j.RollingFileAppender class. Unfortunately none of the log4j-1.2-api,log4j-api and log4j-core libraries contain this class. I do not understand why RollingFileAppender is not present in log4j bridge if manual says that RollingFileAppender is supported component. I have found similar question but without a satisfactory answer. How to migrate RollingFileAppender?
UPDATE
Here is my log4j.properties file:
log4j.rootCategory=INFO, A1, A2
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d%m%M %n
log4j.appender.A2.file=C:/projects/test/Log.log
#log4j.appender.A2.layout=org.apache.log4j.PatternLayout
#log4j.appender.A2.layout.ConversionPattern=[%d{dd.MM HH.mm.ss.SSS} %-5p %-20c{1}] : %m%n
#log4j.appender.A2.MaxFileSize=10000KB
#log4j.appender.A2.MaxBackupIndex=3
I added -Dlog4j2.debug=true. There are tons of logs. I chose interesting logs:
TRACE StatusLogger Trying to find [log4j.properties] using context class loader jdk.internal.loader.ClassLoaders$AppClassLoader#2437c6dc.
DEBUG StatusLogger Not in a ServletContext environment, thus not loading WebLookup plugin.
DEBUG StatusLogger PluginManager 'Log4j Builder' found 18 plugins
DEBUG StatusLogger Parsing for [root] with value=[INFO, A1, A2].
DEBUG StatusLogger Level token is [INFO].
DEBUG StatusLogger Logger root level set to INFO
DEBUG StatusLogger Parsing appender named "A1".
DEBUG StatusLogger PluginManager 'Converter' found 47 plugins
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false.false
DEBUG StatusLogger Adding appender named [A1] to loggerConfig [].
DEBUG StatusLogger Parsing appender named "A2".
WARN StatusLogger Unable to create File Appender, no file name provided
ERROR StatusLogger Unable to create Appender org.apache.log4j.RollingFileAppender due to ClassNotFoundException:org.apache.log4j.RollingFileAppender
DEBUG StatusLogger Appender named [A2] not found.
DEBUG StatusLogger Finished configuring.
The reason configuration fails is explained by the following message:
WARN StatusLogger Unable to create File Appender, no file name provided
This is caused by a compatibility problem between the Log4j 1.x bridge and the original Log4j 1.x: property names must start with a capital letter (cf. LOG4J2-3316). This will be solved in the next release.
Until then, you can use:
log4j.appender.A2.File=C:/projects/test/Log.log
(with a capital F).

How do i configure azure databricks with log4j2

log4j:WARN Failed to set property [rollingPolicy] to value "org.apache.log4j.rolling.TimeBasedRollingPolicy".
log4j:WARN Please set a rolling policy for the DatabricksRollingFileAppender named 'publicFile'
log4j:WARN Failed to set property [rollingPolicy] to value "org.apache.log4j.rolling.TimeBasedRollingPolicy".
log4j:WARN Please set a rolling policy for the DatabricksRollingFileAppender named 'privateFile'
log4j:WARN Failed to set property [rollingPolicy] to value "org.apache.log4j.rolling.TimeBasedRollingPolicy".
log4j:WARN Please set a rolling policy for the DatabricksRollingFileAppender named 'product'
log4j:WARN Failed to set property [rollingPolicy] to value "org.apache.log4j.rolling.TimeBasedRollingPolicy".
log4j:WARN Please set a rolling policy for the DatabricksRollingFileAppender named 'metrics'
log4j:WARN Failed to set property [rollingPolicy] to value "org.apache.log4j.rolling.TimeBasedRollingPolicy".
log4j:WARN Please set a rolling policy for the DatabricksRollingFileAppender named 'usage
As of Datatbricks runtime 11.0 with Spark 3.3.0, log4j has been upgraded to log4j2. I haven't seen official documentation for custom log support but this is what's been working for me.
Similar with log4j 1 support, you need a custom init script to run on the cluster and create a log4j2.properties file. This script might look something like:
#! /bin/bash
set -euxo pipefail
echo "Running on the driver? ${DB_IS_DRIVER}"
echo "Driver ip: ${DB_DRIVER_IP}"
cat >>/databricks/spark/dbconf/log4j/driver/log4j2.properties <<EOL
appender.customFile.type = RollingFile
appender.customFile.name = customFile
appender.customFile.layout.type = PatternLayout
appender.customFile.layout.pattern = %d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n%ex
appender.customFile.filePattern = logs/log4j.custom.%d{yyyy-MM-dd-HH}.log.gz
appender.customFile.policies.type = Policies
appender.customFile.policies.time.type = TimeBasedTriggeringPolicy
appender.customFile.policies.time.interval = 1
appender.customFile.fileName = logs/stdout.custom-active.log
logger.custom=DEBUG, customFile
logger.custom.name = com.custom
logger.custom.additivity = true
EOL
In databricks , you can check the complete details on databricks with log4j2 in here

Hybris server is stuck when I restart it

I stop my server update when it was creating DDL statments and restart the server. Now my server is stuck at below line. I did ant clean all and again tried to start the server but still same issue.
How to resolve this?
log4j:WARN No such property [maxFileSize] in org.apache.log4j.DailyRollingFileAppender.
Feb 07, 2020 2:28:29 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/security/tags is already defined
log4j:WARN No appenders could be found for logger (de.hybris.platform.servicelayer.web.XSSFilter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Feb 07, 2020 2:28:29 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 07, 2020 2:28:30 PM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Run the following SQL request to check if the system is locked.
select process,locked from systeminit ;
if locked = 1, update it to 0.

TIBCO MDM 9 : log4j:WARN No appenders could be found for logger (RulebaseCustomFunction)

Getting below error while I am trying to print MqLog to elink.log via RulebaseCustomFunction (MDM 9)\
ERROR [stderr] (TIBCO EMS Session Dispatcher (895)) log4j:WARN No appenders could be found for logger (RulebaseCustomFunction).
ERROR [stderr] (TIBCO EMS Session Dispatcher (895)) log4j:WARN Please initialize the log4j system properly.
How to Configure in order to avoid above error?
Can somebody help me, please?
Default log4j configuration provided out-of-box does not have appender defined for RulebaseCustomFunction. However, you can always add new appender to ConfigValues.xml
Try adding below in "Logging" category-
<ConfValue description="The debugging logging level CustomRulebaseFunction" name="Logging Level for CustomRulebaseFunction" propname="log4j.logger.RulebaseCustomFunction" sinceVersion="8.0" visibility="All" isHotDeployable="true" isHidden="false">
<ConfString default="DEBUG,elink,error" value="DEBUG,elink,error"/>
</ConfValue>

Runnig Ex-crawler

Hi i am runnig the jar of this open source Ex-Crawler
But i always receive this error :
og4j:WARN No appenders could be found for logger (eu.medsea.mimeutil.TextMimeDetector).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info
The application you're running uses log4j to produce log files. And log4j needs a configuration file, usually named log4j.properties, to be available in the application's class path, in order to start properly.
This is sample of default configuration you might start with:
log4j.rootLogger=WARN, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.conversionPattern=%5p [%t] (%F:%L) - %m%n

Resources