Log Event Types
A canonical list of logging events.
Meya logs a variety of events, including errors, warnings, and other useful information. The table below summarizes the built-in event types and what they mean.
Event | Description |
---|---|
bot.error | Error. General errors encountered when running bots. This category will be refined into other categories in the future. |
bot.pause | Warning. Indicates the bot will not respond to an event because the bot is not currently active. |
component.invoke | Error, Warning, or Info. Provides information about a running custom component. Used for error messages related to running a custom component, and general information. |
component.timeout | Error. Indicates a custom component took too long to execute. |
component.custom.<misc|*> | Error, Warning, or Info. A developer-defined message stemming from a custom component using self.log() . If no type is provided, component.custom.misc is used. |
development.component.deploy | Error, Warning, or Info. Information about deploying a custom component after it's saved. |
development.component.dependencies.deploy | Error, Warning, or Info. Information about deploying Python dependencies after requirements.txt is saved. |
development.github.sync | Error, Warning, or Info. Logs important information about syncing a bot from Github. |
development.github.commit | Error, Warning, or Info. Logs important information about syncing a bot to Github. |
development.github.autosync | Error, Warning, or Info. Logs information about syncing a bot from Github using an automatic repository hook. |
development.zip.import | Error, Warning, or Info. Logs information about syncing a bot from a zip file. |
development.zip.export | Error, Warning, or Info. Logs information about downloading a bot as a zip file. |
flow.start | Logs when a flow has started. |
flow.transition | The flow is transitioning to the next state. This will be logged at the end of each flow as well, since flows have a final hidden empty state. |
flow.custom.<misc|*> | Error, Warning, or Info. A developer-defined message stemming from a flow. If no type is provided, flow.custom.misc is used. |
intent.choose | Info. Information related to which intent was chosen based on a user message. |
intent.nomatch | Warning. Indicates that no intent could be found to process a user message. |
intent.process | Error, Warning, or Info. Logs information related to considering an intent. If an error occurs during intent processing, it is skipped, and logs are important for insight into what happened. |
misc <component|flow>.custom.misc | Info. An uncategorized informational message. This is used for logs that don't (yet) fit other categories. |
<send|receive>.<integration>.event | |
<send|receive>.<integration>.message | A message was sent to, or received from, the user or the bot. |
<send|receive>.<integration>.button_click | The user clicked a button. |
<send|receive>.<integration>.typing | The user or bot is typing. |
<send|receive>.<integration>.read_receipt | The user has read the bot's message. |
<send|receive>.<integration>.delivery | The message was delivered. |
<send|receive>.<integration>.echo | |
<send|receive>.<integration>.payment | |
<send|receive>.<integration>.start_chat | Meya Web only. The user has started a chat with the bot for the first time. |
<send|receive>.<integration>.open_chat | Meya Web only. The user has opened the chat widget. |
<send|receive>.messenger.optin | Messenger only. |
<send|receive>.messenger.account_linking | Messenger only. |
<send|receive>.messenger.pre_checkout | Messenger only. |
<send|receive>.messenger.checkout_update | Messenger only. |
<send|receive>.messenger.referral | Messenger only. |
<send|receive>.messenger.pass_thread_control | Messenger only. |
system.echo.<send|receive> | Info. Used internally for system status/latency checks. |
Integration list
When searching logs using type:<send|receive>.<integration>.<event_type>
, use the event form of the integration's name, as provided in the table below.
Integration | Event Form |
---|---|
Actions on Google | google_actions |
Facebook Messenger | messenger |
Intercom | intercom |
Kik | kik |
Layer | layer |
Meya Test Chat | test |
Meya Web | web |
Slack | slack |
Smooch | smooch |
Telegram | telegram |
Twilio | twilio |
twitter | |
Webhook | webhook |
Inserting custom log messages
In addition to the above list of built-in event types, you can create custom messages and log them within flows using the component.log
component, setting the log
properties in any built-in component, or inserting self.log()
statements in your custom components.
Inserting log messages in a custom component
You can use self.log(<context>, type=<type>, status=<status>)
to log events and messages. These messages will appear in the Logging tab.
from meya import Component
class LogComponent(Component):
def start(self):
text = "Hello, world! From inside a component in Messenger"
status = "error"
context = {
"order": "chicken shawarma",
"sauces": [
"garlic",
"hot"
]
}
self.log(context, type="food", status=status)
print text
message = self.create_message(text=text)
return self.respond(message=message, action="next")
Go to the Logging tab to view your logged message.
There are three properties you can set: status
, type
, and context
.
Property | Description |
---|---|
status | One of either info , error , or warning . You can search by this field. This also controls the icon symbology in the Logging tab on the left-hand side of the screen. |
type | A user-defined string describing what the log message relates to. You can filter results in the Logging tab using type:component.custom.<type> to show only this type of log message. |
context | A user-defined dictionary containing any information you might find useful when troubleshooting. |
Inserting log messages in a component
There are two ways to add a logged message to a component: the log
property, and the log_text
property.
Using
log
andlog_text
at the same timeYou should choose either
log
orlog_text
. Using both on the same component will result in two messages being logged.
The log
property
log
propertyEvery built-in component has a property, log
, which has three sub-properties: context
, status
, and type
.
states:
start:
component: meya.text_buttons
properties:
text: Dog or cat?
output: button_click
buttons:
- text: "dog"
action: next
- text: "cat"
action: next
log_state:
component: meya.text
properties:
text: "You chose {{ flow.button_click }}"
log:
status: "info"
type: "my_log"
context: |
text = {{ flow.value }}
choice = {{ flow.button_click }}
Go to the Logging tab to view your logged message.
The log
property has three sub-properties you can set: status
, type
, and context
.
Property | Description | |
---|---|---|
status | One of either info , error , or warning . You can search by this field. This also controls the icon symbology in the Logging tab on the left-hand side of the screen. | Optional Default: info |
type | A user-defined string describing what the log message relates to. You can filter results in the Logging tab using type:flow.custom.<type> to show only this type of log message. | Optional Default: misc |
context | A user-defined string containing any information you might find useful when troubleshooting. | Optional |
Set at least one property
While all three properties are optional, at least one must be set, or no message will be logged.
The log_text
property
log_text
propertyIf you just want to print a message to the Logging tab and don't need the level of detail status
, type
, and context
provide, use the log_text
property.
states:
log_state:
component: meya.text
properties:
text: "text"
log_text: "my log message"
Go to the Logging tab to view your logged message.
Event type for
log_text
When using
log_text
, the event type is alwaysflow.custom.misc
. You can filter your logs to show only this message type usingtype:flow.custom.misc
.
Property | Description | |
---|---|---|
log_text | A string that will appear in the logs. | Required |
Inserting log messages using the component.log
component
component.log
componentYou can also use the meya.log
component to insert log messages.
states:
start:
component: meya.log
properties:
type: "my_log"
status: "warning"
context: "value = {{ flow.value }}"
Go to the Logging tab to view your logged message.
There are three properties you can set: status
, type
, and context
.
Property | Description | |
---|---|---|
status | One of either info , error , or warning . You can search based on this field. This also controls the icon symbology in the Logging tab on the left-hand side of the screen. | Optional Default: info |
type | A user-defined string describing what the log message relates to. You can filter results in the Logging tab using type:flow.custom.<type> to show only this type of log message. | Optional Default: misc |
context | A user-defined string containing any information you might find useful when troubleshooting. | Optional |
Updated over 6 years ago