> From: [EMAIL PROTECTED] 
> Subject: logkit on an EBCDIC machine
> 
> 
> Hey folks,
> 
> Just tried to incorporate logkit into a Websphere project 
> that is running on an OS390. When using the 
> DatagramOutputTarget and the syslog formatter, my syslog 
> server would receive that logging packet but not record it. I 
> had to change the
> following:
> 
>     protected void write( final String stringData )
>     {
>       try 
>       {
>               final byte[] data = stringData.getBytes("US-ASCII");

I don't like having the encoding parameter hard-coded into the method.

Either:

 1. Use the platform's default encoding: stringData.getBytes()

 2. or make it configurable: stringData.getBytes( m_selectedEncoding )

Maybe hide the string-to-bytes conversion inside a helper method:

protected byte[] stringToBytes (String s) {
    return m_encoding != null ? s.getBytes (m_encoding) : s.getBytes ();
}

> I noticed that StreamTarget write() method has a getBytes as well.

Same goes for that.

Sure, we can stuff something like that into a future release.

/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to