116
Views
18
Comments
Solved
Write a logs in text file for an application
Question

I want to download the log from the application as a text file. Usually the log file is used to download from the Service Center as Excel Sheet. Now I need to write log without using Service center. In downloaded text file I want the logs for error, time, usage, etc.. 

2021-06-03 11-03-21
Anubhav Rai
Solution

Hi @Ajay Saminathan ,
Sorry for the inconvenience, Please check the updated OML for your reference.
This time no dependency error will be popup.

TextLogDemo_V2.oml
2021-06-03 11-03-21
Anubhav Rai
Solution

Hi @Sakthipriya B ,

Just double click on errors and replace the “2” from the redirected screen.

You will need to remove 2 from layouts2 and common2.

This is happening because i copied and pasted my old app logic to new app, so its created duplicate common and layouts.


If everything goes correct hope this time you will be able to publish.


Regards,



2021-06-03 11-03-21
Anubhav Rai

Hi @Sakthipriya B ,
You can get the logs from the Outsystems default tables, and from there you can get the errors to write in your tables.

If you want a specific type of data only then you can create your own list, and deserialize the data to get the error in a JSON/text file.

Also, you can use exception handlers to write the logs manually in your tables.


Please let me know if you have more queries.


Regards,


UserImage.jpg
Sakthipriya B

Can you explain even more clear and also suggest some sample application.

2020-09-21 08-42-47
Vincent Koning

This link should help you determine what log entity to query and how to do that: https://success.outsystems.com/documentation/11/managing_the_applications_lifecycle/monitor_and_troubleshoot/logging_database_and_architecture/the_log_tables_and_views/

Then you can use the ToExcel widget to convert the retrieved data to Excel and let the client download it.

Hope this helps,

Vincent

2021-06-03 11-03-21
Anubhav Rai

I am attaching a demo OML for your reference.
On the screen you will see some logs from the OS default table, if you click on the convert button logs will be converted to text, now you can click on the export button to download the log in the text format.
Please let me know if you have any queries.

TextLogDemo.oml
UserImage.jpg
Sakthipriya B

Hi Anubhav Rai 

In this Text log demo file, the pop up is coming like manage dependencies in that there is file like String split test. I cant able to access the string split dependencies. Due to this i can't able to run the oml file 

2021-06-03 11-03-21
Anubhav Rai

Please check this updated OML.
If still you are getting dependency errors you will need to add the below dependency.

TextLogDemo_V1.oml
UserImage.jpg
Ajay Saminathan



While opening this application its showing StringSplit_Test dependency is not found and can't able to publish the application

2021-06-03 11-03-21
Anubhav Rai

Got it,
Unfortunately, you can not publish my OML, You can ignore this dependency this is not related to your issue.
But still, you can check the implementation.
 Or wait for some time I will provide the new OML.

2021-06-03 11-03-21
Anubhav Rai
Solution

Hi @Ajay Saminathan ,
Sorry for the inconvenience, Please check the updated OML for your reference.
This time no dependency error will be popup.

TextLogDemo_V2.oml
UserImage.jpg
Ajay Saminathan

Thanks , but it's not accessible when publish. Its telling you don't have permission to view this page


2021-06-03 11-03-21
Anubhav Rai

Please share the Screenshot, there is no restriction to view.
Before publishing you can verify if the screen role is anonymous or not.

UserImage.jpg
Sakthipriya B
2021-06-03 11-03-21
Anubhav Rai
Solution

Hi @Sakthipriya B ,

Just double click on errors and replace the “2” from the redirected screen.

You will need to remove 2 from layouts2 and common2.

This is happening because i copied and pasted my old app logic to new app, so its created duplicate common and layouts.


If everything goes correct hope this time you will be able to publish.


Regards,



UserImage.jpg
Sakthipriya B
2025-01-30 09-20-02
Vinayak Siddhiwal

Hi @Sakthipriya B ,

Please find attached OAP for the code reference.

you need to add extra logic to solve this scenario. Let me know if you require more details.

Thanks,

Error Log Download POC.oap
2025-01-30 09-20-02
Vinayak Siddhiwal

Whenever an exception occurs it will get downloaded automatically in text format with proper description.
We can modify same code as per your business needs.

UserImage.jpg
Sakthipriya B

Can you please explain the process in detail for clear understanding. 

2025-04-10 12-15-03
Ankit Sheshkumar Shukla

@Sakthipriya B  
Please find the below link just for reference Click here.


Regards

Ankit

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.