My need is simple – I want to be able to open my text log file in excel, so that it automatically breaks it in columns matching the log fields.
For that, I need the log fields separated with a tab.
My pattern is: %utcdate [%thread] %-5level %logger - %message%newline
I need something like:
%utcdate%tab[%thread]%tab%-5level%tab%logger%tab%message%newline
Thanks.
Caveat: I haven’t actually used log4net. But if I understand correctly, the configuration is an XML file, isn’t it? And the pattern is just text with some special tokens. So have you tried embedding actual tab characters in your pattern? The XML sequence for a tab is
	, e.g.:Or if you’re supplying the pattern some other way (perhaps via the
PatternStringconstructor or whatever), just include tab characters in the string you’re passing in. The docs for that constructor defer to thePatternLayoutdocs to talk about the string itself, and there they say:(Their emphasis.) Worth a try, anyway…