You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example-project/README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ pip install logtail-python
17
17
To run the example application, simply run the following command:
18
18
19
19
```bash
20
-
python main.py <source-token>
20
+
python example-project.py <source-token>
21
21
```
22
22
23
23
Don't forget to replace `<source-token>` with your actual source toke which you can find in the source settings.
@@ -39,7 +39,7 @@ In this section, we will take a look at actual logging as shown in the example p
39
39
40
40
## Setup
41
41
42
-
First, we need to import the Logtail client library to our code. This can be done using the import keyword. We also need to import the default logging library as well.
42
+
First, we need to import the Logtail client library to our code. This can be done using the import keyword. We also need to import the default logging library.
43
43
44
44
```python
45
45
# Import Logtail client library and default logging library
@@ -112,7 +112,7 @@ The code above will generate the following JSON logs:
112
112
"dt":"2022-02-03 12:08:55.642 UTC",
113
113
"context":{
114
114
"runtime":{
115
-
"file_string":"main.py",
115
+
"file_string":"example-project.py",
116
116
"function_string":"<module>",
117
117
"line_integer":"39",
118
118
"logger_name_string":"__main__",
@@ -124,7 +124,7 @@ The code above will generate the following JSON logs:
124
124
"process_name_string":"MainProcess"
125
125
}
126
126
},
127
-
"filename_string":"main.py",
127
+
"filename_string":"example-project.py",
128
128
"level_string":"error",
129
129
"message_string":"Oops! An error occured!",
130
130
"severity_integer":"4"
@@ -134,7 +134,7 @@ The code above will generate the following JSON logs:
134
134
"dt":"2022-02-03 12:08:55.643 UTC",
135
135
"context":{
136
136
"runtime":{
137
-
"file_string":"main.py",
137
+
"file_string":"example-project.py",
138
138
"function_string":"<module>",
139
139
"line_integer":"50",
140
140
"logger_name_string":"__main__",
@@ -146,9 +146,9 @@ The code above will generate the following JSON logs:
146
146
"process_name_string":"MainProcess"
147
147
}
148
148
},
149
-
"filename_string":"main.py",
149
+
"filename_string":"example-project.py",
150
150
"level_string":"error",
151
-
"message_string":"Error occurred while calling non-existing function\nTraceback (most recent call last):\n File \"main.py\", line 48, in <module>\n nonexisting_function() # Calling nonexisting function\nNameError: name 'nonexisting_function' is not defined",
151
+
"message_string":"Error occurred while calling non-existing function\nTraceback (most recent call last):\n File \"example-project.py\", line 48, in <module>\n nonexisting_function() # Calling nonexisting function\nNameError: name 'nonexisting_function' is not defined",
152
152
"severity_integer":"4"
153
153
}
154
154
```
@@ -177,7 +177,7 @@ This will generate the following JSON log:
177
177
"dt":"2022-02-03 12:08:55.642 UTC",
178
178
"context":{
179
179
"runtime":{
180
-
"file_string":"main.py",
180
+
"file_string":"example-project.py",
181
181
"function_string":"<module>",
182
182
"line_integer":"31",
183
183
"logger_name_string":"__main__",
@@ -189,7 +189,7 @@ This will generate the following JSON log:
0 commit comments