Foundation 6

Fnd_Log

17 shared methods.

Fnd_Log_AddEntry

Fnd_Log_AddEntry (text1{; text2..textN; options})

Call this method to add a new entry to the log file. Safe to call even if we're not currently logging activity.

ParameterTypeDirectionDescription
$1..NVariantinText columns; an options object supplies logLabel, logLevel,
ResultoutNone

Fnd_Log_CloseLog

Fnd_Log_CloseLog {(Log Label)}

Pass the log label to save and close that log If you call this without any parameters all the logs will be closed and saved

ParameterTypeDirectionDescription
inLogLabelTextinThe log label (optional)

Fnd_Log_Config

Fnd_Log_Config

Get/set run defaults. Existing named logs retain their declaration settings.

No parameters.

Fnd_Log_CreateTable

Fnd_Log_CreateTable

Explicit interpreted-host-only schema creation; never called by logging. Returns success/created/restartRequired/message.

No parameters.

Fnd_Log_DeclareLog

Fnd_Log_DeclareLog (label{; fileName{; folderPath{; options{; dedicatedWorker}}}})

Allows the declaration of a different log Omitted or empty filenames use the label and preferred extension.

Filenames without an extension acquire the preference; explicit extensions win.

Re-declaring an existing label leaves its filename and folder unchanged.

ParameterTypeDirectionDescription
labelTextinLog Label
inFileNameTextinLog filename (optional)
inFolderPathTextinFolder path (optional)
optionsObjectinDestination, batching and output settings (optional)
dedicatedBooleaninRequest a dedicated worker; default False (optional)

Fnd_Log_Enable

Fnd_Log_Enable ({enable?}) --> Boolean

Allows the developer to turn the logger on or off. Also returns True if logging is currently enabled.

ParameterTypeDirectionDescription
inEnableBooleaninTurn on logging? (optional)
ResultBooleanoutTrue if logging is enabled

Fnd_Log_Extension

Fnd_Log_Extension {($inExtension_t : Text)} --> Text

Gets or sets the preferred log extension for this application run.

Call from On Startup with "log" or ".log"; the initial default is ".txt".

Changes affect new filenames and default-log selections. The calling process follows the new default if it was using the old default filename. Existing named logs and filenames selected by other processes keep their extensions.

Explicit filename extensions override this preference. Nothing is saved to disk.

Case, Unicode, internal spaces and dots are preserved. Rejects ASCII 0-31, <>:"/|?*, and a trailing dot or space. Invalid input leaves the setting unchanged.

Full filename and path-length limits still depend on the target filesystem.

ParameterTypeDirectionDescription
inExtensionTextinExtension with an optional leading dot; empty resets to .txt (optional)
ResultTextoutCurrent preferred extension, including the leading dot

Fnd_Log_FileName

Fnd_Log_FileName (path) --> Text

Gets or sets the file name of the current process's log.

Pass a file name to set it, or call with no parameter to read it.

Setting it to an empty string returns the process to the default log file.

Missing extensions use the run-wide preference; explicit extensions override it.

ParameterTypeDirectionDescription
inPathTextinThe log file name to use (optional)
ResultTextoutThe file name now in use by this process

Fnd_Log_Flush

Fnd_Log_Flush

Queue a flush for a label or all logs; returns before writes complete.

No parameters.

Fnd_Log_FormEventAsText

Fnd_Log_FormEventAsText --> Text

Returns Form event Code as text

ParameterTypeDirectionDescription
ResultTypeoutDescription

Fnd_Log_Info

Fnd_Log_Info (label) --> Text

Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.

ParameterTypeDirectionDescription
requestTextinInfo desired ("version", "name", or "logging")
ResultTextoutResponse

Fnd_Log_Label

Fnd_Log_Label

Return the current process log label; empty means an unnamed/default target.

No parameters.

Fnd_Log_MaximumSize

Fnd_Log_MaximumSize {(Maximum size)} --> Longint

Allows you set the maximum size of log files before they are rolled over.

Pass 0 to indicate 'do not rollover'

A log file will be rolled over and renamed with a timestamp (local timezone) that indicates the time of rollover The rolled over log will then be compressed (zip) and deleted

Eg. "Sales.log" will become "Sales (2021-08-11T103809).log.zip"

ParameterTypeDirectionDescription
inMaximumSizeLongintinMaximum size in bytes (optional)
ResultLongintoutMaximum size

Fnd_Log_OverrideLevel

Fnd_Log_OverrideLevel

Get/set threshold: None -1 disables, Inherit -2 restores application default; optional True sets application scope.

No parameters.

Fnd_Log_Path

Fnd_Log_Path --> Text

Gets or sets the folder of the current process's log.

Pass a folder path to set it, or call with no parameter to read it.

Setting it to an empty string returns the process to the default logs folder.

ParameterTypeDirectionDescription
inFolderTextinThe log folder path to use (optional)
ResultTextoutThe folder path now in use by this process

Fnd_Log_Shutdown

Fnd_Log_Shutdown

Call after producers stop; queue local flush/close/stop without waiting.

No parameters.

Fnd_Log_UseLog

Fnd_Log_UseLog {(Log Label)}

Pass the log label to use, if you omit the label or pass an empty string, the default log will be used Shared with hosts. Selection preserves the process enable flag.

ParameterTypeDirectionDescription
inLogLabelTextinThe log label; omitted or empty selects the default (optional)