You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We create a "Migrate from Log4j 2" that specifies:
- the required changes in the runtime classpath due to the splitting of
modules,
- a warning about the change of the naming convention for configuration
properties,
- a list of migration rules for users that love the Java properties
configuration format.
Part of #2540.
<<properties-configuration-file,check your configuration properties>>,
37
+
* if you used the Java properties configuration format, <<properties-configuration-file,migrate your configuration file>>,
38
+
39
+
[#runtime-dependencies]
40
+
== Runtime dependencies
41
+
42
+
Log4j 2 Core contains many features that depend on optional runtime dependencies.
43
+
In order to comply with the Java Platform Module System and help users managing those dependencies, some features were moved to separate Maven modules.
44
+
This change has the following advantages:
45
+
46
+
* you don't need to consult the documentation to find out, which third-party libraries are necessary to use a specific feature: adding the appropriate Log4j 3 artifact is enough.
47
+
* Log4j 3 does not have optional dependencies, so third-party libraries used by Log4j will be upgraded **automatically** by your dependency management tool, when you upgrade Log4j.
48
+
49
+
The following `log4j-core` features were moved to their own modules or were removed:
footnote:removal[If you are using these components, and you can help us to maintain them, please contact us on our link:/support.html[support channels].]
In order to support per-logger context configuration properties, the configuration properties sub-system of Log4j has been rewritten and the naming convention of properties have changed.
133
+
To help you with the migration process a backward compatibility system has been implemented, which translates Log4j 2 property names to their Log4j 3 equivalents.
134
+
135
+
If you use configuration properties to finely tune Log4j Core, make sure that:
The only significant changes between the Log4j 2 and Log4j 3 properties format are:
157
+
158
+
. As an alternative to using the `type` configuration attribute to specify the **plugin type** of a Log4j component, you can append the plugin type to the prefix of the parent component.
159
+
For example, instead of:
160
+
+
161
+
[source,properties]
162
+
----
163
+
appender.0.type = Console
164
+
appender.0.name = CONSOLE
165
+
appender.1.type = File
166
+
appender.1.name = MAIN
167
+
appender.1.fileName = logs/main.log
168
+
appender.2.type = File
169
+
appender.2.name = DEBUG_LOG
170
+
appender.2.fileName = logs/debug.log
171
+
----
172
+
+
173
+
you can write:
174
+
+
175
+
[source,properties]
176
+
----
177
+
Appenders.Console.name = CONSOLE
178
+
Appenders.File[1].name = MAIN
179
+
Appenders.File[1].fileName = logs/main.log
180
+
Appenders.File[2].name = DEBUG_LOG
181
+
Appenders.File[2].fileName = logs/debug.log
182
+
----
183
+
184
+
. The
185
+
{log4j2-url}/manual/configuration.html#java-properties-features[Java properties format specific quirks]
186
+
are no longer recognized, which means that:
187
+
188
+
* The following direct children of `Configuration` need to use the same prefix as the other formats:
189
+
+
190
+
--
191
+
** You need to replace the `appender` prefix with `Appenders`,
192
+
** You need to replace the `logger` prefix with `Loggers`,
193
+
** You need to replace the `script` prefix with `Scripts`.
194
+
--
195
+
196
+
* Properties that start with `property`, which are used for
0 commit comments