Customize log4net to modify the rotating file-naming convention for Spotfire logs

Customize log4net to modify the rotating file-naming convention for Spotfire logs

book

Article ID: KB0070404

calendar_today

Updated On:

Products Versions
Spotfire Server All Versions

Description

A customer wants to customize the file-naming convention for rotating logs in log4net.config for Web Player logs. This article uses  "Spotfire.Dxp.Web.log" as an example, and describes how to change "Spotfire.Dxp.worker.host.1.log" to "Spotfire.Dxp.worker.host.log.1" 
 

Environment

All supported Windows operating systems

Resolution


1. Launch a command prompt as Administrator on the Spotfire Server machine.
2. Export the Automation Services configuration using the "export-service-config" command. Here is an example: config export-service-config --capability=web_player --deployment-area=Production
For 10.2 and below, the exported configuration files will be saved under the \tomcat\bin\config\root folder.
For 10.3 and above, the exported configuration files will be saved under the \tomcat\Spotfire-bin\config\root folder.
3. The exported configuration files will be saved under the \tomcat\Spotfire-bin\config\root folder.
4. Open the log4net.config file in a plain text editor. Be sure to create a backup before editing.
Please locate the key attribute from log4net, "PreserveLogFileNameExtension," and change the value from true to "false." This will give you the number at the end. This will allow the log to have XXXX.log.1.
-------------------------------------
<PreserveLogFileNameExtension value="false" />
----------------------------------
5. Save the file. If you get a prompt to override the existing file, select "Yes".
6. Import the modified configuration using the "import-service-config" command. Enter the "config-name" value relevant to the changes made. 
7. Launch the Spotfire administration user interface in a web browser and select "Nodes & Services."
8  Edit the Webplayer Service services to use the updated configuration. Look for the "config-name" value you entered while importing the service configuration and update it to use it.

Issue/Introduction

Details on how to modify log4net to customize the rotating file-naming convention for Spotfire logs.

Additional Information

Doc: export-service-config
Doc: import-service-config