Skip to content

Commit

Permalink
chore: add language identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
brnhensley committed May 29, 2023
1 parent 99c09d9 commit bc6fec4
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metaDescription: 'Python API: This call records a log event for use in logging i

## Syntax

```
```py
newrelic.agent.record_log_event(message, level=None, timestamp=None, attributes=None, application=None, priority=None)
```

Expand Down Expand Up @@ -97,7 +97,7 @@ This records a [log event](/docs/logs/logs-context/configure-logs-context-python
</td>

<td>
Optional. Sets the priority of the log event. See [event_harvest_config.harvest_limits.log_event_data](/docs/apm/agents/python-agent/configuration/python-agent-configuration#event_harvest_config.harvest_limits.log_event_data) for additional information on how priority affects logging events.
Optional. Sets the priority of the log event. See [`event_harvest_config.harvest_limits.log_event_data`](/docs/apm/agents/python-agent/configuration/python-agent-configuration#event_harvest_config.harvest_limits.log_event_data) for additional information on how priority affects logging events.
</td>
</tr>
</tbody>
Expand All @@ -113,20 +113,20 @@ None.

Here's an example of recording a log event associated with a background task:

```
```py
@newrelic.agent.background_task()
def bg_task():
# do some type of work in this background task...
application = newrelic.agent.application()
newrelic.agent.record_log_event('My log message.', application)
# do some type of work in this background task...
application = newrelic.agent.application()
newrelic.agent.record_log_event('My log message.', application)
```

### Record log event in transaction [#transaction-event]

An example of recording a log event inside a transaction:

```
```py
def fetch():
newrelic.agent.record_log_event('Fetching data.')
# do some type of work in this transaction...
newrelic.agent.record_log_event('Fetching data.')
# do some type of work in this transaction...
```

0 comments on commit bc6fec4

Please sign in to comment.