Upgrading Logging from an Earlier Version
This topic contains the following sections:
The API to deal with manual messages and custom activities (see Adding Custom Log Records Manually) has been completely revamped. The old API, based on the Logger, still works but is no longer recommended for new developments. However, there is no compelling reasons to replace it with the new LogSource-based API in existing developments.
For existing code, we suggest you selectively disable the obsolescence warning using a #pragma directive:
#pragma warning disable 618 Logger.GetLogger().Write( LogLevel.Error, "Text" ); #pragma warning restore 618
PostSharp Logging has been completely rewritten between PostSharp 4.3 and PostSharp 5.0. There are some significant breaking changes that you will need to take into account.
To migrate your logging from PostSharp 4.3 or earlier:
Uninstall all PostSharp.Patterns.Diagnostics.* packages except PostSharp.Patterns.Diagnostics itself
Upgrade all PostSharp packages.
Add the package for your backend logging framework to the start-up project (instead of adding it to all projects prior to PostSharp 5.0) and configure it at run-time as described in Getting Started with PostSharp Logging.
Migrate the logging profiles to the new format as described in Getting Started with PostSharp Logging. Some options that used to be accessible from logging profiles are now run-time options and are described in Customizing the Appearance of Log Records.