You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Ben Monroe (Created) (JIRA)" <ji...@apache.org> on 2012/03/28 04:29:22 UTC

[jira] [Created] (LOG4NET-329) Allow creation of UTF-8 logs without a BOM.

Allow creation of UTF-8 logs without a BOM.
-------------------------------------------

                 Key: LOG4NET-329
                 URL: https://issues.apache.org/jira/browse/LOG4NET-329
             Project: Log4net
          Issue Type: Wish
          Components: Appenders
    Affects Versions: 1.2.11
         Environment: Windows 7.
            Reporter: Ben Monroe
            Priority: Minor


When an appender uses the "utf-8" encoding, output logs will append a BOM to the start of a file. This is problematic when the log file is only supposed to output errors. Explorer reports the file size as non-0, so the only way to know if an error actually occurred is to open the log every time and check. This is not desirable.

Further, from the Unicode FAQ (http://unicode.org/faq/utf_bom.html), a BOM is unnecessary for UTF-8 since it is already a sequence of bytes, so there are no endian problems to solve in the first place.

Removal of the BOM is not necessary, but should also provide a means to use UTF-8 without a BOM. That could be a new encoding name such as "utf-8_nobom" or as a separate attribute such as "bom=false" or something else.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (LOG4NET-329) Allow creation of UTF-8 logs without a BOM.

Posted by "Ben (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben resolved LOG4NET-329.
-------------------------

    Resolution: Not A Problem

As per the comments, this feature is already available via the type attribute.
                
> Allow creation of UTF-8 logs without a BOM.
> -------------------------------------------
>
>                 Key: LOG4NET-329
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-329
>             Project: Log4net
>          Issue Type: Wish
>          Components: Appenders
>    Affects Versions: 1.2.11
>         Environment: Windows 7.
>            Reporter: Ben
>            Priority: Minor
>              Labels: appender, encodings, unicode
>
> When an appender uses the "utf-8" encoding, output logs will append a BOM to the start of a file. This is problematic when the log file is only supposed to output errors. Explorer reports the file size as non-0, so the only way to know if an error actually occurred is to open the log every time and check. This is not desirable.
> Further, from the Unicode FAQ (http://unicode.org/faq/utf_bom.html), a BOM is unnecessary for UTF-8 since it is already a sequence of bytes, so there are no endian problems to solve in the first place.
> Removal of the BOM is not necessary, but should also provide a means to use UTF-8 without a BOM. That could be a new encoding name such as "utf-8_nobom" or as a separate attribute such as "bom=false" or something else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (LOG4NET-329) Allow creation of UTF-8 logs without a BOM.

Posted by "Stefan Bodewig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288118#comment-13288118 ] 

Stefan Bodewig commented on LOG4NET-329:
----------------------------------------

FileAppender's Encoding property is a System.Text.Encoding.  You can suppress the BOM by passing in an instance of System.Text.UTF8Encoding which - according to its docs - doesn't write a BOM when created using the default constructor.

I think it should be possible to do so via the configuration already, something like

<encoding type="System.Text.UTF8Encoding"/>
                
> Allow creation of UTF-8 logs without a BOM.
> -------------------------------------------
>
>                 Key: LOG4NET-329
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-329
>             Project: Log4net
>          Issue Type: Wish
>          Components: Appenders
>    Affects Versions: 1.2.11
>         Environment: Windows 7.
>            Reporter: Ben
>            Priority: Minor
>              Labels: appender, encodings, unicode
>
> When an appender uses the "utf-8" encoding, output logs will append a BOM to the start of a file. This is problematic when the log file is only supposed to output errors. Explorer reports the file size as non-0, so the only way to know if an error actually occurred is to open the log every time and check. This is not desirable.
> Further, from the Unicode FAQ (http://unicode.org/faq/utf_bom.html), a BOM is unnecessary for UTF-8 since it is already a sequence of bytes, so there are no endian problems to solve in the first place.
> Removal of the BOM is not necessary, but should also provide a means to use UTF-8 without a BOM. That could be a new encoding name such as "utf-8_nobom" or as a separate attribute such as "bom=false" or something else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (LOG4NET-329) Allow creation of UTF-8 logs without a BOM.

Posted by "Ben (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LOG4NET-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13289099#comment-13289099 ] 

Ben commented on LOG4NET-329:
-----------------------------

Thank you.
I can confirm that this works.
I was only familiar with the value attribute and was not aware that a type attribute was available.
The existing functionality is sufficient, so I will mark this as resolved.
                
> Allow creation of UTF-8 logs without a BOM.
> -------------------------------------------
>
>                 Key: LOG4NET-329
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-329
>             Project: Log4net
>          Issue Type: Wish
>          Components: Appenders
>    Affects Versions: 1.2.11
>         Environment: Windows 7.
>            Reporter: Ben
>            Priority: Minor
>              Labels: appender, encodings, unicode
>
> When an appender uses the "utf-8" encoding, output logs will append a BOM to the start of a file. This is problematic when the log file is only supposed to output errors. Explorer reports the file size as non-0, so the only way to know if an error actually occurred is to open the log every time and check. This is not desirable.
> Further, from the Unicode FAQ (http://unicode.org/faq/utf_bom.html), a BOM is unnecessary for UTF-8 since it is already a sequence of bytes, so there are no endian problems to solve in the first place.
> Removal of the BOM is not necessary, but should also provide a means to use UTF-8 without a BOM. That could be a new encoding name such as "utf-8_nobom" or as a separate attribute such as "bom=false" or something else.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira