To output Chinese or Korean characters using XmlLayout you could try escaping log messages before even sending them to the log4net ILog object. In C#, something like the following is what I'm talking about:
public class Foo {
private ILog log = LogManager.GetLogger(typeof(Foo));
private void LogSomething(string message) {
//replace the chinese yen symbol with its xml character escape sequence
//for more info on escape sequences
log.Debug(message.Replace("\u00A5", "¥"));
}
}
That is a workaround that might work for you, but it sounds like an issue with XmlLayout class IMO. XmlLayout is responsible for converting log messages to xml, so it should correctly escape unicode characters for you and not require the caller to have knowledge of the log output format.
For the build issue, it sounds like you are running into a strong naming issue. The private key used to sign log4net.dll is not distributed with the source download packages. If you compile an application against log4net.dll that is distributed by Apache and later replace that with a modified log4net.dll that you compiled, then you will get this error (because the strong name keys are not the same).
I would suggest that if you are going to modify the log4net source and compile it yourself that you create a new strong name key and use that to sign your modified version. You will then need to recompile everything that references log4net in your application (make sure it references the customized dll at compile time).
|