View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

Retail:Hardware and Peripherals Logging

Contents

Introduction

The Hardware Manager includes logging capabilities that is configured in the file logging.properties located in the Hardware Manager folder. Logging can be configured to debug and track internal events that can be sent to the console, a file or even to a network socket. Adding to this logging capabilities, the Hardware Manager include since RR14Q2.3 basic audit capabilities where all receipts, reports sent to the receipt printer and customer display can be stored to a file.

This logging capability is based in the standard Java Logging API, and the configuration file logging.properties is actually the configuration file for the Java Logging API the Hardware Manager logging is based on. You have an overview of the Java Logging API in the following document http://docs.oracle.com/javase/6/docs/technotes/guides/logging/overview.html .

Logging

There are two basic configuration options that activate logging: The logging handlers and the logging level.

The logging handlers are the output where logging records are sent. By default there are no logging handlers active that means that no logging activity will be recorded. There are two preconfigured logging handlers in the Hardware Manager: the console, and a rotating file located in the home folder named file-logging-0.log. These preconfigured logging handlers can be activated just removing the comment of the lines affected.

To activate the handlers edit the line:

 handlers=

To activate the console logging handler add java.util.logging.ConsoleHandler and to add the rotating file logging handler add java.util.logging.ConsoleHandler. You can active one handler or both.

Each logging record in the Hardware Manager has a level. You can configure the level you want to log in the line

.level=

By default the level is INFO that means that logging records with INFO level or greater will be sent to logging handlers. If you want to log records that are set as warning or a higher level, set the level property to WARNING. The available levels in the Java Logging API are: SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST. It is not recommended to set the level below CONFIG in production environments to not to flood the logging output.

To configure in detail the logging handlers, logging level and other logging details go to the following tutorial: http://tutorials.jenkov.com/java-logging/configuration.html .

Auditing

Auditing is preconfigured to send a copy of all information sent to the receipt printer and customer display to a rotated log file located in the home folder named file-audit-0.log. By default auditing is enabled. To enable or disable auditing edit the following property:

AuditLogger.level=

Set it to ALL to activate auditing or OFF to disable it. Audit files must be properly planned because can be huge files after some time. Consider configure auditing to store the audit file in an appropriated file system and also configure rotating the file to limit the size of logging.

You must restart the Hardware Manager to activate all the modifications done in the logging.properties configuration file.

Inspecting logging files

Log files are usually very long text files that are difficult to read using a plain text editor or reader. It is a good idea to use an specialized tool for reading log files. Here there is an example of the audit log file opened with the tool OtrosLogViewer that can be found in the following link: https://code.google.com/p/otroslogviewer/ .

Olvaudit.png

In this example the audit file is opened and it is filtering to show only the receipts sent.

Retrieved from "http://wiki.openbravo.com/wiki/Retail:Hardware_and_Peripherals_Logging"

This page has been accessed 1,583 times. This page was last modified on 30 July 2014, at 08:52. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.