1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>

Expert Sessions!

Archiving Application Logs

Tuesday, 31 July 2012 12:36

Written by Prakash Palani

Print E-mail

 

The application tool is a tool that collects messages, exceptions, warnings and errors, logs from different applications are written to the database and contain information on messages/events for further analysis. These logs get accumulated over the period of time but are not automatically deleted.  Application events can be logged centrally in the application log.

 

The log for an object comprises:
- The log header (table BALHDR) with a unique log number:
This provides information about who triggered a particular event, using which program or transaction.
- Multiple numbers of log messages and their urgency status (tables BALDAT).

Application Logs - Expiration Date

Every log written to the database will usually be assigned with an expiration date, which is the date to which the logs must be retained in the database. The same is set by the application logic which updates the BAL* tables, please note that expiration date cannot be set by the end user or administrators, it is a application managed setting. Moreover, expiration date does not mean that the logs will be deleted automatically from the systems. The DEL_BEFORE indicator in the BALHDR table determins whether the log can be deleted before it reaches the expiration date.

Tables involved in the application logs are BALDAT, BALHDR, BAL_INDX and BALM.

Avoidance of updating Application logs


There is no general procedure for activating or deactivating the application log. Some applications provide this option or let you reduce the number of entries created, please refer OSS Notes, 183960, 373688, 393667, 376555 and 460310.


Application Logs: Deletion

From Release 4.6A, transaction SLG2 can be used to delete records according to the selection criteria specified, in addition to that, you can also use SBAL_DELETE program to schedule it as a background job at pre-defined intervals.

Upto Release 4.5B, RSSLG200 report deletes all the logs with expired dates, another report RSSLGK90 deletes all messages with an expiry date too far in the future or no expiry date.

Pre-requisites for deletion: As mentioned in the previous sections, application log entries can be deleted after the esxpiry date is reached. However, if the DEL_BEFORE is set to blank (not ‘x’), then these logs can be deleted even before reaching the expiry date.

Only Important for CRM Systems:

In CRM systems, application logs with subobject type "SINGLE" must not be deleted with deletion report SBAL_DELETE (see SAP Note 595856). Table entries with subtype "SINGLE" are deleted while archiving CRM documents with the related archiving objects. For more information, see the "Archiving" section.


Selection fields for the SBAL_DELETE delete program (transaction SLG2):

- Object
- Sub-Object
- External ID
- Transaction Code
- User
- Log Number
- Problem Class
- From Date (BALHDR-ALDATE)
- To Date (BALHDR-ALDATE)
- Transaction Code

Expiry Date
You can delete logs that have reached their expiry date or you can delete logs before the expiry date.

Options
- Only calculate the amount => this is a simulation
- Generate list => The report identifies the logs that can be deleted and displays a list from which you have to select the logs to delete.
- Delete immediately => The report identifies the logs that can be deleted and deletes them without any further input from the user.

Application Logs: Archiving

Application logs can be archived using archiving object BC_SBAL, reloading back to the database is not possible with this archive object.


Prerequisites for Archiving


A log can be archived only if it has expired (expiration date has been reached or has passed) or it can be deleted before the expiration date (DEL_BEFORE flag).


Dependencies to Other Objects

There are no dependencies to other archiving objects.

SAP recommends to archive application logs after 6 months since they probably do not have to be accessed frequently any more

{fcomment} {flike}
Share
Archiving Application Logs