Hot answers tagged

15

You can use a RollingFileAppender instead of the default Sitecore one and configure it to roll by date. You can find samples in the log4net config examples section of the documentation. Specifically with Sitecore, change the appender(s) to the following: <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender, Sitecore.Logging"> ...


12

In log4net you can use a filter on the level in your appender like this: <threshold value="DEBUG"/> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="DEBUG" /> <levelMax value="INFO" /> </filter> Not sure whether the syntax in Sitecore will be the same as I didn't test it. The threshold value specifies that ...


8

When working with the Global.asax file, even though the question is inheriting from Sitecore.ContentSearch.SolrProvider.NinjectIntegration.NinjectApplication, if you keep digging down, eventually you'll find that also inherits from the HttpApplication class. Ordinarily, this class exists in the System.Web namespace. However, when choosing protected as your ...


8

Yes. You need a new <appender>. First you need to set up a table to receive the logging information: CREATE TABLE [dbo].[Log] ( [Id] [int] IDENTITY (1, 1) NOT NULL, [Date] [datetime] NOT NULL, [Thread] [varchar] (255) NOT NULL, [Level] [varchar] (50) NOT NULL, [Logger] [varchar] (255) NOT NULL, [Message] [varchar] (4000) NOT ...


7

Sounds like you need Sitecore Sidekick Audit Logger - its a package you can install and provides much more detailed audit logging than the standard log files. You can search the log: Search by item: and in the results you can see the details of the changes: Should give you most of what you need. EDIT: Installation Instructions Added The easiest way to ...


7

You forgot to use patch:attribute syntax. Valid patch file: <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <log4net> <root> <priority> <patch:attribute name="value">ERROR</patch:attribute> </priority&...


6

First, start by adding multiple appender to your app.config: <appender name="site1" type="log4net.Appender.RollingFileAppender"> <file value="site1.txt" /> <appendToFile value="true" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date %message%newline" /> ...


6

With this solution, it will create a new log file call audit.{date}.log and log any change the users make to the content. To achieve this, the pipeline subscribes the audit class to the item:creating, saving, deleting, copying, moving, renamed, sortorderchanged, templatechanged and itemProcessed events. Each time one of these events is triggered, a new log ...


5

Sitecore logging system is wrapper under log4net. It is even configured not under <sitecore> node in web.config. To use Sitecore log files you should have 3 things: Configured <log4net> section in web.config file. (If your service layer is hosted from same folder as Sitecore then nothing should be changed. Otherwise you can copy log4net section ...


4

You can start by creating a table for logging, Preferably in your own separate Database, Then you can update your Log4Net configurations to use the SQL appender, Alex Shyba article shows how you can do that, Basically you will need the following: Create Your own Table for logging inside your own Database, Let say SitecoreSystem CREATE TABLE [dbo].[Log] ( ...


3

I talk about this in a series of posts (https://grantkillian.wordpress.com/2014/12/26/sitecore-logging-to-the-database-part-1/, https://grantkillian.wordpress.com/2014/12/26/sitecore-logging-to-the-database-part-2-earning-the-good-developer-badge/, and https://grantkillian.wordpress.com/2014/12/26/sitecore-logging-to-the-database-part-3-the-performance-...


2

As far as I understand Sitecore initially used the same version naming for Sitecore.Logging as log4net. For example, when I look on Sitecore 6.6.0 rev. 120918 I see 1.2.0.30715. Same version is for example for 8.0 rev. 141020. When you will look on different Sitecore.Logging assemblies on MyGet server you will see that that till Sitecore 8.2, log4net ...


2

You can use the log4net.Appender.FileAppender <appender name="FileAppender" type="log4net.Appender.FileAppender"> <file value="log-file.txt" /> <appendToFile value="true" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%...


2

Assuming that you already checked that the configs of local and staging are in sync: did you try with log4net internal debugging? When log4net is working on one location and not on the other this has helped me a few times. Try enabling this and (re-)start your application. If the connection cannot be established (as seems the case) -e.g. if anything is ...


1

You will need to patch your change in, since the settings you are trying to affect are in the Sitecore.config. <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <log4net> <appender name="LogFileAppender" type="log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging"> ...


1

If your Service Layerdoesn't has any dependencies with Sitecore and it can't be added (in some reasons), I can suggest adding an additional class libriary (Project), then adding the reference to the Sitecore.Kernel Secondly, you need add something like a wrapper for the Sitecore Loger: using System; namespace Your.Namespace { public static class ...


1

Seems someone has covered this, and shows where sitecore adds the process id https://sitecore.unic.com/2015/01/27/create-a-single-sitecore-log-file-per-day However worth considering why sitecore adds the process id to the log file if it already exists http://hectorcorrea.com/blog/log4net-thread-safe-but-not-process-safe/17 When IIS recycles with overlapped ...


1

If it is just dev machine, I use SIM Log analyzer


Only top voted, non community-wiki answers of a minimum length are eligible