Comments (6)
The problem is due to a typo in your configuration file:
logger.CBORuleLogger.filter.marker.type = MarkerFilter
logger.CBORuleLogger.filter.marker.marker = FULL_PLAN
logger.CBORuleLogger.filter.marker.onMatch = DENY
logger.CBORuleLogger.filter.marker.onMisMatch = NEUTRAL
You have onMisMatch
instead of onMismatch
. The misleading error message is due to the following code in PropertiesConfigurationBuilder
:
Since you don't have an onMismatch
attribute, the code creates a synthetic onMismatch
attribute with an invalid null
value.
Remark: Fixing this also fixes LOG4J2-2931, so I am redirecting that issue here.
PS: I noticed that Apache Hive uses a pre-2.6 properties configuration format (the loggers
is not required since version 2.6).
Would you consider switching to a more easily readable configuration format? Version 3.x will introduce breaking changes to the properties format, but not the hierarchical ones.
from logging-log4j2.
I note from https://issues.apache.org/jira/browse/LOG4J2-3644 that the
packages
property seems to be straightforward to remove, though Migrate log4j2 to logback jmeter#5937 on theapache/jmeter
side is still unclear as to the way forward.
There is no problem in Apache Hive: I checked that the appropriate annotation processor is configured in the hive-exec
project and there is a Log4j2Plugins.dat
file in the JAR. You can safely remove the packages
configuration attribute.
* I will say that I personally don't know how to fix [Fix handling of `onMatch` and `onMismatch` attributes in the properties configuration format #2791](https://github.com/apache/logging-log4j2/issues/2791) with the `good first issue` tag.
I believe that the problem breaks down to a missing null-check: ComponentBuilder#addAttribute
should add an attribute if the value is not null
and remove it if the value is null
.
null
is never a valid value for an attribute.
BTW: All the problems you are having are due to the fact that TestHplsqlLocal
and TestHplsqlOffline
are fragile tests. They write something to System.out
and they make assertions about that. The problem is: other components (like the status logger) might also write to System.out
. I proposed a solution to this in apache/hive#5381
from logging-log4j2.
Hi @linghengqian,
Could you point us to how you generate the GraalVM image?
As almost all filters (except DenyAllFilter
and Filters
), MarkerFilter
has a onMismatch
property. I suspect that the GraalVM reflection metadata you use might lack the property, hence the problem in the native image.
from logging-log4j2.
Hi @linghengqian,
Could you point us to how you generate the GraalVM image?
As almost all filters (except
DenyAllFilter
andFilters
),MarkerFilter
has aonMismatch
property. I suspect that the GraalVM reflection metadata you use might lack the property, hence the problem in the native image.
-
Hi, the steps I mentioned in the issue description never involve using log4j2 under GraalVM Native Image. I assume you are referring to apache/shardingsphere#31526 . On the shardingspehre side, all nativeTest under GraalVM Native Image have excluded log4j2 in maven pom, and I am actually waiting for the release of log4j2 2.24.0.
-
On the hive side, the Error Log of
ERROR MarkerFilter contains an invalid element or attribute "onMismatch"
is obtained by executing unit tests under Hotspot JDK 8. Hive can still only be compiled with openjdk 8, and it is too early to discuss graalvm native image in the hive community.
from logging-log4j2.
-
Late reply, because I need to wait for verification on
apache/hive
's CI side.apache/hive
's CI resources are too tight, andapache/hive
's jenkins node limits each contributor to 5 hours between 2 consecutive CIs. To be honest, apache/hive#5375 is the first PR I opened on apache/hive's side, and I know almost nothing aboutapache/hive
's logging design. -
I updated apache/hive#5375 not long ago, I removed the
packages
,appenders
,loggers
nodes of/hive/data/conf/hive-log4j2.properties
, and changedlogger.CBORuleLogger.filter.marker.onMisMatch
tologger.CBORuleLogger.filter.marker.onMismatch
.apache/hive
's CI is now back on apache/logging-log4j2:2.23.0. I'm assuming this is a reasonable way forward to not break compatibility with future versions of log4j2. I'm assuming the changes are in line with what's documented in apache/pulsar#22327 , https://logging.apache.org/log4j/2.x/manual/configuration.html , and https://logging.apache.org/log4j/2.x/manual/plugins.html . I note from https://issues.apache.org/jira/browse/LOG4J2-3644 that thepackages
property seems to be straightforward to remove, though apache/jmeter#5937 on theapache/jmeter
side is still unclear as to the way forward.
2024-08-02T10:55:16.634Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-08-02T10:55:16.650Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-08-02T10:55:16.670Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
2024-08-02T10:55:16.686Z main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
-
On the
apache/hive
side, I noticed a new issue when bump fromapache/logging-log4j2:2.23.0
toapache/logging-log4j2:2.23.1
, thestatus = INFO
defined inhive-log4j2.properties
is no longer valid, and Log4j2 internal logs atTRACE
andDEBUG
levels will be printed starting fromapache/logging-log4j2:2.23.1
. Since the current issue is bound to https://issues.apache.org/jira/browse/LOG4J2-2931 , I opened #2794 to avoid ambiguity. -
I will say that I personally don't know how to fix #2791 with the
good first issue
tag.
from logging-log4j2.
Hi @linghengqian,
Could you point us to how you generate the GraalVM image?
As almost all filters (except
DenyAllFilter
andFilters
),MarkerFilter
has aonMismatch
property. I suspect that the GraalVM reflection metadata you use might lack the property, hence the problem in the native image.
- As an external update, I have provided a partial GRM for log4j2 at #1539 (comment) .
from logging-log4j2.
Related Issues (20)
- Official website down HOT 3
- `StatusLogger` initialization fails on J9 VM HOT 10
- Debug level logs are getting printed when log level is set WARN HOT 3
- Add support for event context lookup evaluation in the `NoSql` appender HOT 8
- All plugin builder attributes should have setters
- log4j2.disableJmx and/or log4j2.disable.jmx seem not to work HOT 8
- Disable programmatic configuration if `log4j1.compatibility` is `false` (LOG4J2-3467) HOT 1
- Location information missing when using "File Location" pattern in "all loggers asynchronous" case
- 0点日志归档错误
- Uniformize TLS configuration HOT 2
- Socket Appender has no default port value for `UDP` HOT 2
- When bump from 2.23.0 to 2.23.1, the `status` of the `.properties` configuration file no longer works HOT 7
- Rewrite Jetty-based unit tests HOT 1
- InaccessibleObjectException when serializing JsonLayout with JDK17+ HOT 3
- [MS21] Native Compilation Support #1 HOT 2
- [MS22] Native Compilation Support #2
- [MS23] Native Compilation Support #3
- [MS24] Native Compilation Support #4
- Several ClassNotFoundException warnings after upgrading to 2.23.x HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logging-log4j2.