How to create a Category Log?

In the backend, it shows that we can different category loggers (mine only has SERVER_CODE).

How do we create a new category logger? This is implied as possible but not detailed specifically in the docs, and just putting in a name for a non-existant one didn’t seem to do anything in a codeless UI log action.

To be clear, I’m not talking about the levels, (Debug, warn, etc…), but new category loggers.

Thanks for an awesome product!

Hi Will,

Do you use codeless? If so, there are two ways to log a message. One of them is the print block, it will also way use the SERVER_CODE logging category. Alternatively, you can use the Log a message block as shown below:
Codeless - BL - ConsoleDemo - Backendless 2021-08-31 16-10-00

Hope this helps.

Regards,
Mark

Hi Mark,

I am using codeless, and it’s Good to know on the print option.

I was using the log a message block in codeless, but it never created the logger name, or logged any message. I did it a basic on-click event for a button to test

Here’s my block. I did the alert just to prove to myself I was binding text right, then I tried just using text directly to eliminate any errors.

image001.png

In testing now, I got rid of the alert message, and it actually logged a couple of events and created the channel, but then it stopped working.

image002.png

To be clear, I’m not seeing it in the real-time logging console, when trying to use it from the preview window, and only the few messages that did show up, appear in the file version of the log.

I even published the app to try it for real, and no change to results.

Backend app id:

BC15B8A1-608A-D1C8-FFFE-72FC3E75A700

Thanks,

Also just discovered I can create a logger here, under data → system data → data browser → new!

image001.png

Further info, I am starting to see the appearance of the loggers the button click should have created, but no messages yet. I am going to string together some date times for the log messsage to see if it’s just super-delayed.

I pushed this live, and hit the button 3 times to see what happens:
Also did a similar version in preview, without the live text.

One more update, I enabled Loggly, and I’m not seeing any logs there either…

You put this topic into the “Server Code” category and I assumed you’re talking about server code/business logic, however, your screenshot shows codeless logic for the “On Click Event” and it would mean it is the UI Builder logic. In this case, you need to configure a logging policy as shown below:
UI Builder - AlexaApp - Backendless 2021-08-31 21-37-31

The value of 1 indicates that the logging buffer will be the size of 1 message (meaning the log messages will be sent to the server right away). The value of 0 for the flush frequency doesn’t really apply when the number of messages is set to 1. Read the doc linked above for more details.

Regards,
Mark

The logging policy solved it, thanks Mark!