---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/logs](../index.md) / parseLogEntry

# Function: parseLogEntry()

> **parseLogEntry**(`firstLine`, `file`, `fullMessage`, `pathNormalizer?`): [`LogEntry`](../interfaces/LogEntry.md)

Defined in: [packages/b2c-tooling-sdk/src/operations/logs/tail.ts:60](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/67fb8580ac3c5b372617ee3ec3fc8f2bc9f16174/packages/b2c-tooling-sdk/src/operations/logs/tail.ts#L60)

Parses the first line of a log entry to extract timestamp, level, and message.

Expected format: [timestamp GMT] LEVEL context - message
Example: [2025-01-25 10:30:45.123 GMT] ERROR PipelineCallServlet|... - Error message

The message field will contain:
- The content portion from the first line (after LEVEL)
- Plus any continuation lines (stack traces, etc.)

If the standard B2C log format is not matched, returns an unparsed entry with only
the file, message, and raw fields. The timestamp and level fields will be undefined
in this case, but the raw log line is preserved for debugging or recovery purposes.

## Parameters

### firstLine

`string`

First line of the log entry

### file

`string`

File name the entry came from

### fullMessage

`string`

Complete raw message including all lines

### pathNormalizer?

(`msg`) => `string`

Optional function to normalize paths in the message

## Returns

[`LogEntry`](../interfaces/LogEntry.md)

Parsed log entry; fields timestamp and level may be undefined if format doesn't match
