Extending Lumberjack²
Lumberjack offers one extension point that makes it possible to attach custom metadata to messages.
When first launching Lumberjack, an Extensions
folder will be created. Put your plugins in here.
Implementation
To develop an extension, create a .NET library project in Visual Studio and reference the executable. To provide a metadata extension, implement IMessageAspectAnalyzer
and export your classes via MEF.
[Export(typeof(IMessageAspectAnalyzer))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class BasicAuthenticationMessageAspectAnalyzer : IMessageAspectAnalyzer
{
public bool IsTransient => true;
public IDictionary<string, string> Analyze(Message message)
{
...
}
}
The IsTransient
property indicates, whether the analyzer should before displaying the message (IsTransient = true
) or before persisting it to the message store (IsTransient = false
). Transient metadata cannot be searched for, it is merely used to enhance the message display. An internal example of this is the formatted message display (which is internally metadata).
The dictionary returned from your extension contains the metadata added. Return null
means not to add any metadata.
Deployment
To deploy your extension, just drop it into the Extensions
folder and restart Lumberjack. To debug, you can just attach to the Lumberjack process and set breakpoints as expected.