[
https://issues.apache.org/jira/browse/LOG4J2-3694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17910054#comment-17910054
]
Piotr Karwasz commented on LOG4J2-3694:
---------------------------------------
[~JWT007],
Please open a [GitHub issue|https://github.com/apache/logging-log4j2/issues]
instead. See LOG4J2-3692 for details.
> Javadoc: TypeConverters convert for "Level" incorrectly documents behaviour
> for invalid value
> ---------------------------------------------------------------------------------------------
>
> Key: LOG4J2-3694
> URL: https://issues.apache.org/jira/browse/LOG4J2-3694
> Project: Log4j 2
> Issue Type: Bug
> Components: API, Configuration
> Affects Versions: 2.24.0
> Reporter: Jeff Thomas
> Priority: Trivial
> Labels: newbie
>
> Minor Javadoc correction.
> In TypeConverters, the conversion for type "Level" says it returns 'null' for
> invalid levels:
> {code:java}
> /**
> * Converts a {@link String} into a Log4j {@link Level}. Returns {@code null}
> for invalid level names.
> */
> @Plugin(name = "Level", category = CATEGORY)
> public static class LevelConverter implements TypeConverter<Level> {
> @Override
> public Level convert(final String s) {
> return Level.valueOf(s);
> }
> } {code}
> But {{Level.valueOf(s)}} throws an IllegalArgumentException for unknown
> levels.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)