Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18407

Add ability to inject a Logger into a WikiComponent document

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • 13.1
    • Component
    • None
    • Unknown

    Description

      This issue is about adding the ability to inject a Logger via the XWiki.ComponentDepencencyClass into a WikiComponent implemented as a document.

      Currently, when declaring a dependency on org.slf4j.Logger in such a WikiComponent document, the following error is fired:

      WikiComponentInvocationHandler - No component found for role [interface org.slf4j.Logger] with hint [default], declared as dependency for wiki component [xwiki:XWiki.MyWikiComponent] 
      

      For now, the WikiComponent documentation page mentions that the logging ScriptService can be used to log messages from a WikiComponent. If this issue gets fixed, this documentation should be updated to recommend using an injected logger instead.

      Attachments

        Activity

          People

            Unassigned Unassigned
            slauriere slauriere
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: