Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

FWLogMsg

FWLogMsg(cSeverity, [cTransactionId], cGroup, [cCategory], [cStep], [cMsgId], [cMessage], [nMensure], [nElapseTime], [aMessage])

Records a structured Framework log message.

FWLogMsgAdvPL
01 · OVERVIEW

Overview

The API standardizes LogMsg with severity, group and correlation fields. Documented severities include INFO, WARN, ERROR, FATAL and DEBUG; debug requires FWLOGMSG_DEBUG configuration. With aMessage in console mode, cMessage is omitted to reduce overload. This example logs only an editorial message without user data, tokens or file contents. Logging is not a business commit. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

FWLogMsg(cSeverity, [cTransactionId], cGroup, [cCategory], [cStep], [cMsgId], [cMessage], [nMensure], [nElapseTime], [aMessage])

Parameters

cSeverity
CharacterRequired

INFO, WARN, ERROR, FATAL or DEBUG.

cTransactionId
CharacterOptional

Correlation ID; LAST reuses the previous one.

cGroup
CharacterRequired

Message group.

cCategory
CharacterOptional

Message category.

cStep
CharacterOptional

Processing step.

cMsgId
CharacterOptional

Message identifier.

cMessage
CharacterOptional

Text message, documented 10K limit.

nMensure
NumericOptional

Message measurement unit.

nElapseTime
NumericOptional

Elapsed time supplied by the routine.

aMessage
ArrayOptional

Extra key/value data; affects cMessage in console mode.

Return value

Formal return unspecified in the page; unused here.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed435()
    // Fictional message without secrets.
    FWLogMsg("INFO",,"EDITORIAL",,,"ED435","Editorial review")
Return Nil
Expected result

Record follows LogServer/ConsoleLog configuration if executed. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check context and return before integration; the example does not replace a complete routine.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. FWLogMsg. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha