You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2002/05/21 15:32:02 UTC

DO NOT REPLY [Bug 9285] New: - SyslogWriter 's bug for multibyte enviroment

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9285>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9285

SyslogWriter 's bug for multibyte enviroment

           Summary: SyslogWriter 's bug for multibyte enviroment
           Product: Log4j
           Version: unspecified
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Other
        AssignedTo: log4j-dev@jakarta.apache.org
        ReportedBy: moto@no4.co.jp


Hi,

I'm using log4j package(Version is 1.2.1) in project.
As Happen, when I used SyslogAppender and SyslogWriter for syslogd.
Written word is unperfectly to syslogd's "messages" file.
This word is so short than I expect that.

I thought, it's a enviroment problem with unicode.
Because I use log4j on multibyte enviroment.
(Spec:Fujitsu Solalis SunBlade 1000)
Then, I read log4j package's sources. I detected un-appropiate codes.

Next code is referd for "SyslogWriter.java".

>  public
>  void write(String string) throws IOException {
>    DatagramPacket packet = new DatagramPacket(string.getBytes(),
>        string.length(), 
>        address, SYSLOG_PORT);
>
>    if(this.ds != null)
>      ds.send(packet);
>    
>  }

"DatagramPacket()" 's second parameter is "string.length()".
But I thought. This suitable code is "string.getBytes().length".

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>