Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-473

Option for file extension in SmtpPickupDirAppender

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.13
    • Fix Version/s: 1.2.14
    • Component/s: None
    • Labels:
      None
    • Flags:
      Patch

      Description

      Especially on Windows file extensions are very handy, if you give the output files the `eml` extension you can just double click the file to open the mail in outlook.

      I have added a `FileExtension` option to the `SmtpPickupDirAppender` that can be used to specify a file extension for the generated files.

      Although a default value of `eml` would be nice I have preserved backwards compatibility of no file extension by default.

        Activity

        Hide
        AlbinSunnanbo Albin Sunnanbo added a comment -

        Sorry for being sloppy and not providing any unit tests, but I couldn't find any test for the SmtpPickupDirAppender to begin with.

        Show
        AlbinSunnanbo Albin Sunnanbo added a comment - Sorry for being sloppy and not providing any unit tests, but I couldn't find any test for the SmtpPickupDirAppender to begin with.
        Hide
        AlbinSunnanbo Albin Sunnanbo added a comment -

        Can I provide any more assistance to get this path evaluated and/or merged?

        Show
        AlbinSunnanbo Albin Sunnanbo added a comment - Can I provide any more assistance to get this path evaluated and/or merged?
        Hide
        nachbarslumpi Dominik Psenner added a comment -

        I've just tried to apply your patch and there are issues:

        Your patch does not apply neatly to current trunk, please make your patches such that they are based on the trunk root path and apply to trunk.

        The more concerning issue is that even though you have added properties and attributes, they are not used anywhere. The patch doesn't add anything that will use that file extension if it is provided, does it?

        Cheers

        Show
        nachbarslumpi Dominik Psenner added a comment - I've just tried to apply your patch and there are issues: Your patch does not apply neatly to current trunk, please make your patches such that they are based on the trunk root path and apply to trunk. The more concerning issue is that even though you have added properties and attributes, they are not used anywhere. The patch doesn't add anything that will use that file extension if it is provided, does it? Cheers
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user albinsunnanbo opened a pull request:

        https://github.com/apache/log4net/pull/19

        File extension for smtp appender

        Add a configuration option for adding a file extension to the generated mails.
        Updated patch from https://issues.apache.org/jira/browse/LOG4NET-473

        Based on https://github.com/apache/log4net/pull/17

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/albinsunnanbo/log4net FileExtensionForSmtpAppender

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/log4net/pull/19.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #19


        commit 899579668d6b75711a425005fa4861fdeb3932e1
        Author: Albin Sunnanbo <albin@sunnanbo.com>
        Date: 2015-11-01T09:35:54Z

        Create basic SmtpPickupDirAppenderTest

        commit 9f0a9e0857d58cec19673de95c2a28292dfdc171
        Author: Albin Sunnanbo <albin@sunnanbo.com>
        Date: 2015-10-31T21:32:41Z

        Add option for file extensions to the SmtpPickupDirAppender

        • Especially on Windows file extensions are very handy, if you give the output files the `eml` extension you can just double click the file to open the mail in outlook.
        • I have added a `FileExtension` option to the `SmtpPickupDirAppender` that can be used to specify a file extension for the generated files.
        • Although a default value of `eml` would be nice I have preserved backwards compatibility of no file extension by default.

        Show
        githubbot ASF GitHub Bot added a comment - GitHub user albinsunnanbo opened a pull request: https://github.com/apache/log4net/pull/19 File extension for smtp appender Add a configuration option for adding a file extension to the generated mails. Updated patch from https://issues.apache.org/jira/browse/LOG4NET-473 Based on https://github.com/apache/log4net/pull/17 You can merge this pull request into a Git repository by running: $ git pull https://github.com/albinsunnanbo/log4net FileExtensionForSmtpAppender Alternatively you can review and apply these changes as the patch at: https://github.com/apache/log4net/pull/19.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #19 commit 899579668d6b75711a425005fa4861fdeb3932e1 Author: Albin Sunnanbo <albin@sunnanbo.com> Date: 2015-11-01T09:35:54Z Create basic SmtpPickupDirAppenderTest commit 9f0a9e0857d58cec19673de95c2a28292dfdc171 Author: Albin Sunnanbo <albin@sunnanbo.com> Date: 2015-10-31T21:32:41Z Add option for file extensions to the SmtpPickupDirAppender Especially on Windows file extensions are very handy, if you give the output files the `eml` extension you can just double click the file to open the mail in outlook. I have added a `FileExtension` option to the `SmtpPickupDirAppender` that can be used to specify a file extension for the generated files. Although a default value of `eml` would be nice I have preserved backwards compatibility of no file extension by default.
        Hide
        AlbinSunnanbo Albin Sunnanbo added a comment -

        Hi again
        It looks like my SVN skills have been decaying. Sorry for that.
        I found the GIT-version of the source and supplied a fixed version of the above patch as a pull request in https://github.com/apache/log4net/pull/19
        I also created a basic test for the SmtpPickupDirAppender in https://github.com/apache/log4net/pull/17

        Additionally I created a pull request for generating a Date header in https://github.com/apache/log4net/pull/18
        I prefer separate pull requests for each feature in GIT, but if you prefer the contribution as a single pull request or an SVN path I can fix that.

        Show
        AlbinSunnanbo Albin Sunnanbo added a comment - Hi again It looks like my SVN skills have been decaying. Sorry for that. I found the GIT-version of the source and supplied a fixed version of the above patch as a pull request in https://github.com/apache/log4net/pull/19 I also created a basic test for the SmtpPickupDirAppender in https://github.com/apache/log4net/pull/17 Additionally I created a pull request for generating a Date header in https://github.com/apache/log4net/pull/18 I prefer separate pull requests for each feature in GIT, but if you prefer the contribution as a single pull request or an SVN path I can fix that.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/log4net/pull/19

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/log4net/pull/19
        Hide
        nachbarslumpi Dominik Psenner added a comment -

        Thanks for your efforts! I've merged your pull request as svn revision 1711836.

        I've merged also the other pull requests as svn revisions 1711832 and 1711831. If there's still some work to be done feel free to reopen this issue.

        Show
        nachbarslumpi Dominik Psenner added a comment - Thanks for your efforts! I've merged your pull request as svn revision 1711836. I've merged also the other pull requests as svn revisions 1711832 and 1711831. If there's still some work to be done feel free to reopen this issue.

          People

          • Assignee:
            nachbarslumpi Dominik Psenner
            Reporter:
            AlbinSunnanbo Albin Sunnanbo
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development