Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1559

Improve subAppend function in OutputStreamAppender

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • logback-core
    • None

    Description

      Currently, if we want to write a custom appender on top of OutputStreamAppender we have to override subAppend(E event) and copy code from OutputStreamAppender which is not desirable as then we have to keep track of changes made in the OutputStreamAppender and update our custom appender accordingly.

      To avoid this we can replace these lines with the writeOut(event) method.
      Now if someone wants to extend OutputStreamAppender he can just override writeOut method.

       

      Also, the writeBytes method in OutputStreamAppender is private so we have to copy the function in our appender which is not desirable. (We can make writeBytes protected for this)

       

      PR : https://github.com/qos-ch/logback/pull/519

      Attachments

        Activity

          People

            logback-dev Logback dev list
            akshaypatidar Akshay Patidar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: