Being able to view your log files within one central location can make debugging and troubleshooting a lot simpler. Like most things nowadays, there are several third-party products that you can buy to achieve this. This year, it seems a lot of companies are choosing Stackify to accomplish this. Out of the box, Stackify won't add your Episerver logs into its log portal. If you want to learn how to do this, then read on.
How To Add My Epi Logs To Stackify
Luckily, getting your logs into Stackify is very easy. First, I'm assuming that you've installed the Stackify agent onto your server. Next, you need to install the Stackify Log4Net package into your solution:
Or, you can install the Stackify.Log4Net appender with NuGet command 'Install-Package StackifyLib.log4net'. Note: During installation, you'll be prompted to add your activation key.
Update your web.config file with the following app settings:
<appSettings> <add key="Stackify.ApiKey" value="*** GET FROM ACCOUNT ADMIN ***" /> <add key="Stackify.AppName" value="ENTER_APPNAME_HERE" /> <!-- environment optional - inferred by Stackify if running on a monitored server --> <add key="Stackify.Environment" value="ENTER_ENVIRONMENT_HERE" /> </appSettings>
Next, you'll need to update your 'EPiServerLog.config' file and point it to Stackify. Previously, I've just set my default appender to use the Stackify version, so I'd change this line:
<appender name="FileLogAppender" type="log4net.Appender.RollingFileAppender" >
<appender name="FileLogAppender" type="StackifyLib.log4net.StackifyAppender, StackifyLib.log4net" >
That should be it, if you look at the Logs section in Stackify, you should see your Episerver logs!