Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Optional ConditionMethod arguments, ignoreCase argument for standard condition methods, EventLogTarget enhancements #12

Open
wants to merge 8 commits into
from

Conversation

Projects
None yet
1 participant

tg73 commented Oct 6, 2011

Hi Jaroslaw,

  1. I noted that the ability to specify case sensitivity was present in the deprecated "whenEquals" (etc) conditions, but not in the newer "when" condition. So I've added support for optional (defaulted) arguments for ConditionMethod methods, and given the standard string-related ones an optional ignoreCase argument.
  2. The users of our product need to see information in the Windows EventLog, but for certain information they don't want one message per log event - they want several log events combined into one Event Log entry, otherwise they get upset. This was not possible unless we combined information within our own application, as LogEventTarget does not support batched writes. So I've modified LogEventTarget to (optionally) support batched writes (see AllowBatching property). It now derives from TargetWithLayoutHeaderAndFooter, and has an AddNewLines property similar to the MailTarget. There's also a GroupByLevel property which allows a batch write to be gouped by EventLogEntryType and written as one EventLog entry per entry type - otherwise the greatest severity within the batch of LogEvents is used.

As a general note, I couldn't find any "how to contribute" documentation, so I'm not sure how you handle contributions, notably regarding copyright. For now, I've added copyright entries in the files I've touched/created with my name, but I'm open to discussion on this.

I've built the code via build.cmd for netfx40, netfx35, netfx20 and sl3 (that's all the SDKs I've got installed) and addressed any code analysis issues. I've tested under netfx40 (including my silverlight-only code). I've also verified that the generated XSD appears to be correct for the EventLogTarget changes, and syncronized projects.

Regards,

Tom

tg73 added some commits Oct 6, 2011

@tg73 tg73 Various enhancements to EventLogTarget:
- header and footer, with optional newlines
- batched writes (eg, via Buffering wrapper), with optional per-LogLevel grouping
- two overflow handling modes - truncate (what it always used to do) and split (currently a simplistic implementation)
3fe9ce7
@tg73 tg73 Added continuation logic 5073402
@tg73 tg73 Support optional parameters in [ConditionMethod] methods. Optional pa…
…rameters can be omitted from the end of the parameter list (only).
9d96f22
@tg73 tg73 Added optional ignoreCase argument to string-related ConditionMethods…
…, retaining original behaviour as the default. Added new strequals function for string comparison with optional ignoreCase argument.
17e31a3
@tg73 tg73 Synchronize projects 80df970
@tg73 tg73 Fix compilation for silverlight 784a23c
@tg73 tg73 Implement optional parameters that work for .NET 2.0 and above, and S…
…ilverlight.
313840c
@tg73 tg73 Corrected copyright from recent work 5f8f246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment