You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/03/07 07:50:32 UTC

[jira] [Commented] (LOG4J2-1839) JdbcAppender.createAppender deprecated

    [ https://issues.apache.org/jira/browse/LOG4J2-1839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15898890#comment-15898890 ] 

ASF subversion and git services commented on LOG4J2-1839:
---------------------------------------------------------

Commit d5b5df4dc9a314a2a48cd14223ac9007b4260273 in logging-log4j2's branch refs/heads/master from ggregory
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=d5b5df4 ]

Refactor existing test before playing with [LOG4J2-1839]

> JdbcAppender.createAppender deprecated
> --------------------------------------
>
>                 Key: LOG4J2-1839
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1839
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 2.8.1
>            Reporter: Krzysztof Szymko
>             Fix For: 2.8.2
>
>
> As I was migrating 2.7 to 2.8.1  I followed JdbcAppender.<B>newBuilder() API to build JDBC appender:        
>  return JdbcAppender.<B>newBuilder()
>             .setBufferSize(bufferSizeInt)
>             .setColumnConfigs(columnConfigs)
>             .setConnectionSource(connectionSource)
>             .setTableName(tableName)
>             .withName(name)
>             .withIgnoreExceptions(ignoreExceptions)
>             .withFilter(filter)
>             .build();
> But then I got NPE from JdbcDatabaseManagerFactory @ 275, since
> I did not set any columnMappings. After providing 
> .setColumnMappings(columnMappingJDBC)
> to my builder it worked OK. I would suggest to either improve the javadoc or add NULL check in JdbcDatabaseManagerFactory.createManager
> as JdbcAppender javadoc says that ColumnMapping is optional:
> This Appender writes logging events to a relational database using standard JDBC mechanisms. It takes a list of
>  * {@link ColumnConfig}s and/or {@link ColumnMapping}s with 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org