Technical ManualsSana Commerce Logging

Sana Commerce Logging

Sana Commerce 9.3
Your connector

Logging in Sana Commerce

If you encounter any problems with your Sana Commerce webstore on a production environment, it is important to check the error message to troubleshoot the problem. The error messages can be seen in the log files. Two logging methods are available:

  • Logging in a log file
  • Sending log information by e-mail

Sana Commerce uses the Logging Application Block from Enterprise Library. This is a collection of generic reusable software components delivered by Microsoft. With this logging component it is possible to specify trace listeners in the 'Web.config' file. Listeners are actually subscriptions of the log types.

Four default trace listeners are specified in the Sana Commerce 'Web.config' file:

  • EmailTraceListener - Sends log entries as e-mail messages.
  • FileTraceListener - Writes log entries to a text file. It can also create a new log file based on the current date and time or when the file reaches a certain size.
  • PaymentFileTraceListener - Payment providers log file that can be used when you encounter some problems with payments.
  • TaskFileTraceListener - Scheduled tasks log files. The log files of the scheduled tasks can be seen directly in Sana Admin, but it is also configured to write logging information into text files and e-mail messages. For more information, see 'Scheduled Tasks'.

The logging configuration can be seen in the Sana Commerce frontend 'Web.config' file, the <loggingConfiguration> section.

Logging can be enabled/disabled by changing the value of the tracingEnabled attribute. By default logging is enabled.

The table below provides the description of the EmailTraceListener attributes:

Attributes Description
toAddress Enter the e-mail address to which the log entry should be sent.
fromAddress Enter the e-mail address where the log entry is originated. This address is shown in the 'From' field if the received e-mail.
smtpPort Enter the SMTP port that receives e-mail messages.
Default: 25

The table below provides the description of the FileTraceListener, PaymentFileTraceListener and TaskFileTraceListener attributes:

Attributes Description
fileName The path where the log file should be stored and the name of the log file.
   If Sana Commerce is hosted on multiple servers you can also specify the name of the server where the log files are stored. When the server name is specified it will be shown in Sana Admin on the 'Logs' page.
timeStampPattern The date/time format that is automatically added to the log file name.
rollSizeKB The maximum size of the log file in kilobytes.

In Sana Admin on the ERP Connection page it is also possible to enable logging. If logging is enabled in Sana Admin all requests from the Sana Admin and webstore to ERP and responses will be written into the tracelog file on the server. By default logging in Sana Admin is disabled as it affects performance. Therefore, it is better to use it only for debugging purposes. For more information, see 'ERP Connection'.

Technical ManualsSana Commerce Logging