1

We are using Sitecore Publishing Service Module for publishing. But when it comes to publishing logs. It provides a very limited amount of information. We moved its logging level to INFO still we are not getting a lot of info.

For eg number of items published, User_name of the publisher. We do get this kind of info for OOTB publishing logs. But we are missing above mentioned info here in this module logs. As it's a marketplace module. we have no access to the source code to modify the code. And in an official document also there is no mention of it. If someone can suggest how to achieve it?

2 Answers 2

0

Change the logging level to DEBUG to get additional information. be careful with enabling DEBUG. It is great for getting details, but it will overload your server with the heavy I/O streaming on the log files. Use it with caution.

Publishing Service only logs data on the Information logging level by default. You can find the default logging configuration in the (PublishingServiceInstallationFolder)/config/sitecore/sc.logging.xml file of the publishing service installation location.

To Override the default logging level, first step is to create a file named sc.logging.json in the (PublishingServiceInstallationFolder)/config/development/ folder and add the following:

{
    "Sitecore": {
        "Publishing": {
            "Logging": {
                "Filters": {
                    "Sitecore": "Debug"
                }
            }
        }
    }
}

Now, you have to start the Publishing Service in development mode to get additional logging information. In the (PublishingServiceInstallationFolder)/web.config file add the following entry within aspNetCore the node.

<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development">
</environmentVariables>

Finally, restart the application pool of your Publishing Service host.

Reference: https://joaoneto.blog/publishing-service-enable-debug-logging-level/

Hope it helps!

1
  • Thanks for your reply. I have tried the approach you mentioned. But it is not providing the desired results. I am looking to customize publishing logs that we are getting here for this module
    – Himanshu
    Commented May 23, 2023 at 9:02
0

By default, the Publishing Service outputs any messages to a log file (found in the logs directory). But you can temporarily run the service in Development Mode. This mode will allow you to see Debug (DBG) message output and also everything will be logged to the console as well as the log file. This is useful for diagnosing any errors in these early setup phases.

To start the Publishing Service in Development Mode you need to pass the parameter development to the environment switch.

.\Sitecore.Framework.Publishing.Host.exe --environment development

NOTE: If you start the service without the environment switch then the service will start in Production mode which only shows Information (INF) level messages and outputs only to the log file.

Refer to this article for more details.

http://www.stephenpope.co.uk/publishing

Hope this helps.

1
  • Thanks for your reply. I have tried the approach you mentioned. But it is not providing the desired results. I am looking to customize publishing logs that we are getting here for this module
    – Himanshu
    Commented May 23, 2023 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.