Skip to content

Bugfix/log4 j 3359 2 #3502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,17 @@ public Integer convert(final String s) {
}

/**
* Converts a {@link String} into a Log4j {@link Level}. Returns {@code null} for invalid level names.
* Converts a {@link String} into a Log4j {@link Level}.
*/
@Plugin(name = "Level", category = CATEGORY)
public static class LevelConverter implements TypeConverter<Level> {
/**
* {@inheritDoc}
* @param s the string to convert
* @return the resolved level
* @throws NullPointerException if the given value is {@code null}.
* @throws IllegalArgumentException if the given argument is not resolvable to a level
*/
@Override
public Level convert(final String s) {
return Level.valueOf(s);
Expand Down
10 changes: 10 additions & 0 deletions src/changelog/.2.x.x/3359_fix-javadoc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="fixed">
<issue id="3359" link="https://github.com/apache/logging-log4j2/issues/3359"/>
<description format="asciidoc">
TypeConverters convert for "Level" incorrectly documented behaviour for invalid value - updated javadoc.
</description>
</entry>
Loading