Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Later
    • Affects Version/s: None
    • Fix Version/s: 0.4
    • Component/s: None
    • Labels:
      None

      Description

      Logger is generally boilerplate code:

      private static final Logger LOGGER = LoggerFactory.getLogger(Foo.class);

      it could be very nice to get the logger injected by cdi:

      @Inject private Logger logger;

      Then it could be enhanced providing qualifiers for several log implementations (slf4j, log4j, commons-logging...)

      There is such a feature in weld (weld-clogger) and codi.

        Activity

        Hide
        Mark Struberg added a comment -

        shipped with deltaspike-0.4

        Show
        Mark Struberg added a comment - shipped with deltaspike-0.4
        Hide
        Jason Porter added a comment -

        I'm fine NOT doing this for the reasons listed above. It's very trivial for users to create a producer for a logger.

        Show
        Jason Porter added a comment - I'm fine NOT doing this for the reasons listed above. It's very trivial for users to create a producer for a logger.
        Hide
        Mark Struberg added a comment -

        What was the outcome of the discussion? Afair we settled on not implementing this as logging is hell anyway and we do not like to introduce just another logging framework. Also we would need to handle Serialisation which is only implementable in a performant way if you know the underlying logging framework. Imo all this just doesn't make sense from a pure performance aspect.

        Show
        Mark Struberg added a comment - What was the outcome of the discussion? Afair we settled on not implementing this as logging is hell anyway and we do not like to introduce just another logging framework. Also we would need to handle Serialisation which is only implementable in a performant way if you know the underlying logging framework. Imo all this just doesn't make sense from a pure performance aspect.
        Hide
        Gerhard Petracek added a comment -

        in case of codi it isn't an injection for static fields.
        we just have DELTASPIKE-59 and it isn't about logger injection.
        it needs to be discussed on the list -> please start a discussion thread.

        Show
        Gerhard Petracek added a comment - in case of codi it isn't an injection for static fields. we just have DELTASPIKE-59 and it isn't about logger injection. it needs to be discussed on the list -> please start a discussion thread.
        Hide
        Mark Struberg added a comment -

        Injection into static fields is not supported in CDI-1.0.

        Also this has a ton of other implications...
        Gerhard, didn't we have a JIRA for a Logger discussion already?

        Show
        Mark Struberg added a comment - Injection into static fields is not supported in CDI-1.0. Also this has a ton of other implications... Gerhard, didn't we have a JIRA for a Logger discussion already?

          People

          • Assignee:
            Gerhard Petracek
            Reporter:
            Romain Manni-Bucau
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development