Tags:
create new tag
view all tags

APPX Usage Log

The APPX Usage log gives you the ability to track session log on/off, process execution and more.

Overview

The APPX Usage log can be used to track the execution of APPX processes, session start/end, error messages and C-asserts. It is controlled by setting 2 environment variables. See Setting Environment Variables for a discussion on setting them.

Activation

To activate the usage log, set the environment variable APPX_USAGE_LOG to a file name. If the file name ends in '.dat', it will created in the $APPXPATH/0SA/Data folder. Do not specifiy a path in this case. This file is 'multi user safe', i.e., multiple sesssions can log to this file simultaneously. This is the recommended format.

If the file name does not end in .dat, it will created in the path specified, and multple sessions logging to it will probably make it unreadable.

The ULOG file in 0LC contains the layout of the log file.

To control what events are logged, set APPX_USAGE_BITS according the following:

00000001 (dec 1)   - logs process begin and end (OS process ID, 
                     application ID, version, database, process 
                     type, and process name) 
00000002 (dec 2)   - log CASSERT's 
00000004 (dec 4)   - currently unused 
00000008 (dec 8)   - currently unused 
00000010 (dec 16)  - log CANCEL, ERROR, WARNING, and MESSAGE statements 
00000020 (dec 32)  - log ERROR, WARNING, and MESSAGE statements 
00000040 (dec 64)  - log WARNING and MESSAGE statements 
00000080 (dec 128) - log MESSAGE statements 
00000100 (dec 256) - log TRACE messages 
00000200 (dec 512) - log session start/end 80000000 - log date and time of process execution

These are hex values so 00000040+00000080 is not 00000120, it is 000000c0 (decimal 192). For example: APPX_USAGE_BITS=0x00000001 would log only processes begin and end. APPX_USAGE_BITS=0x80000103 would log the date and time of process execution, process begin and end, the date and time execution started and ended, and CASSERTs (80000000 + 01 + 02 + 100 = 0x80000103).

The first record written for each session contains the time, OS process ID, and user name.

If APPX_USAGE_BITS is not set, then APPX_USAGE_LOG logs all of the above events.

Reading the Usage Log

To read the usage log, design transfer the ULOG file from 0LC to an application of your choice and then create any reports or inputs you require. Since the actual log file is stored in $APPXPATH/0SA/Data, which is not normally readable by standard APPX processes, you will have to copy to a standard location within a database.

For example, if we design transferred ULOG to the DMO application in Database ABC, then on a Linux/Unix server we could:

$ cp $APPXPATH/0SA/Data/ULOG.dat $APPXPATH/ABC/DMO/Data/ULOG.dat

We could also use the .FILE COPY API to copy the file without regard to the underlying operating system.

Comments

-- Jean Neron - 2016-04-06

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2018-03-27 - JoeOrtagus
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback