Posts

How to enable custom logger in Sitecore

Image
  Below are the steps to enable a custom logger: 1. Install Sitecore.Logging assembly in Project form Nuget Package manager. Please select Dependency Behavior as Ignore Dependencies . Create CustomLogger.config file in AppSetting/Include/Project folder with below content.You can change log folder and log file name by changing value in config file .  <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <log4net> <logger name=" CustomLogger " additivity="false"> <level value="DEBUG"/> <appender-ref ref=" CustomLogFile "/> </logger> <appender name=" CustomLogFile "> <patch:attribute name="type">log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging</patch:attribute> <file> <patch:attribute na...

How to upload webp image in Sitecore CMS

Image
Sitecore don't support webp extension to upload in media library. We need to customize sitecore to enable to upload webp extension. We need to create webp items in Media folder in Template section of content tree, as per below step in master database. Duplicate  below two items in CMS with name webp : 1. /sitecore/templates/System/Media/Unversioned/Jpeg  Enter webp in name popup which comes after clicking duplicate option.    path of new item: /sitecore/templates/System/Media/Unversioned/webp 2.   /sitecore/templates/System/Media/Versioned/Jpeg Enter webp in name popup which comes after clicking duplicate option.  path of new item: /sitecore/templates/System/Media/Versioned/webp We need to create a config patch file    /Include/Foundation/*ProjectName*/CustomImageExtension.config  with below line :   <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">   <sitec...