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 "PJ Fanning (JIRA)" <ji...@apache.org> on 2016/12/15 22:05:58 UTC

[jira] [Created] (LOG4J2-1742) scala: add support for creating custom plugins

PJ Fanning created LOG4J2-1742:
----------------------------------

             Summary: scala: add support for creating custom plugins
                 Key: LOG4J2-1742
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1742
             Project: Log4j 2
          Issue Type: Improvement
          Components: Plugins
    Affects Versions: 2.7
            Reporter: PJ Fanning


I tried to add a custom appender using Scala but the pattern of having a class with an Plugin annotation and a static method on that class with a PluginFactory or PluginBuilderFactory annotation doesn't seem to work in Scala.
In Scala, you can create a companion object to a class where you can implement the equivalent of static methods but these are not the same class under the hood. The Scala compiler builds 2 or more classes, the companion object gets a class name with a $ appended to it. I think this is affecting the lookup for the method with the Factory annotation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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