Project

General

Profile

SESSION FWD-LOGFILE Attribute

SESSION:FWD-LOGFILE is a custom attribute, that enhances the OpenEdge handle SESSION. The attribute is specific to the FWD framework and offers a read-only access to the FWD client log filepath.

There are several types of log files in FWD, some replica of OpenEdge log options, others found only in the FWD framework. FWD produces a custom FWD log file for each client process with a default file path of fwd_%m_%tY%tm%td_%tH%tM%tS_%uos_%pid_%uf_%as_%g.log, that gets resolved to a file path similar to fwd_client_20230718_153548_OSUSER_156085_bogus_0.log or fwd_client_20230718_153526_OSUSER_155893_appserver_process_app_server_0.log. This file is configurable in directory.xml with server/default/logging/file/path, in user / process configs in directory or directly in the client bootstrap (file and cmd line), so the actual path can vary greatly. SESSION:FWD-LOGFILE offers an easy way to access this file path from 4GL code. It can also be accessed in the server Java code with EnvironmentOps.getFwdLogfile, if the current Thread has the security context for the client session.

SESSION:FWD-LOGFILE is the absolute path to the client log file found on the client host, when server/default/logging/serverside is FALSE (by default) and on the server host, when TRUE. For appserver client process, web clients (Virtual Desktop and Embedded) and scheduled batch the client host is the server host or the broker host (when brokers are configured).

When file rotation is enabled, SESSION:FWD-LOGFILE represents only the latest log file generated, that is always the one with %g specifier replaced by 0, as that's how JDK FileHandler rotation logic works.

Example:

message SESSION:FWD-LOGFILE.

The above 4GL statement will produce a message with an example value of /opt/logs/fwd_client_20230718_153548_osuser_156085_bogus_0.log, representing the client log file path on the client host.

Troubleshooting:

If the file cannot be found in the specified location make sure:
  • it hasn't been deleted manually or by automated process (redeployment or cron);
  • to look for it on the right host (client / server / broker);

© 2023 Golden Code Development Corporation. ALL RIGHTS RESERVED.