Platform
Logs
9 min
parse server logs introduction in this guide, you will learn about the logs that you can find at the back4app dashboard goal understand the logs system info error access prerequisites there are no pre requisites to read this page logs searching for logs? you’re in the right place ) logs are essential for development or production apps, it is an important way to understand what is happening with an aggregate output of the running processes you must be able to track the app’s behaviors application event logging is critical for understanding the requests and identifying possible loops or bugs in your code you can check them at the left menu, on cloud code cloud code > logs logs it looks like the image below system the system log shows the logs of console log() console log() and console error() console error() and all general logs of everything that happens with your app info here will appear the warnings about cloud code functions and triggers, as well as live query status error errors related to your cloud code functions or the database access this block contains information about the requests that are coming into the server the information is essential to understand where the data is being accessed from, as well as how it’s being accessed, by whom, and the status of requests sample logs here you can find some examples of back4app logs system at back4app, the parse cache module is set by default at versions higher than 2 8 4 therefore, it’s also possible to see some warnings from parse server initialization cloud code syntax errors and also console log from cloud code triggers info when the server url and live query are enabled for a class, a message will appear in this section calling a cloud code function will also be logged here running a cloud code function without a return statement error timeout errors cloud code triggers errors (see the example below) 1 beforesave failed for myclass for user undefined 2 input {"name" "person","createdat" "2021 06 16t17 12 54 863z","updatedat" "2021 06 16t17 17 14 717z","objectid" "aswn26ns4q"} 3 error {"message" "you cannot save a person with age under 18!","code" 141} access 1 2974 431\ c7dc 5bb0 51ec 6258 6a16\ e12b \[2021 06 16t16 48 32 352z] "post /serverinfo" 200 1 ms 217 bytes in 732 bytes out 2 2974 431\ c7dc 5bb0 51ec 6258 6a16\ e12b \[2021 06 16t16 47 26 879z] "get /classes/myfirstclass" 200 50 ms 248 bytes in 24 bytes out 3 2974 431\ c7dc 5bb0 51ec 6258 6a16\ e12b \[2021 06 16t16 46 57 068z] "put /classes/myfirstclass/ao2ezfuqrs" 200 9 ms 240 bytes in 40 bytes out after the endpoints, we can verify the response status code check some examples below 1 200 = the request has succeeded 2 201 = the request has succeeded and a new resource has been created as a result this is typically the response sent after post or put requests 3 204 = no content 4 400 = bad request 5 401 = unauthorized 6 404 = not found 7 408 = request timeout 8 500 = internal server error 9 502 = bad gateway calling cloud code functions will appear here too 1 2804 431\ c7dc 5bb0 51ec 6258 6a16\ e12b \[2021 06 16t17 10 16 245z] "post /functions/hello" 200 2 ms 2 bytes in 32 bytes out