Languages

Menu
Sites
Language
Logging to file.

Hello,

I want to redirect AppLog() output from console to a file. Accoring to Tizen help: "When debugging your application, the log information is written to log files or to the IDE console". But I can't find how can I redirect the output to file. Or probably there are some other ways to write logs output to file?

Thanks in advance!

Responses

12 Replies
Alex Dem

Hi,
You could try to use sdb dlog command (for example):
C:\tizen-sdk\tools>sdb root on
C:\tizen-sdk\tools>sdb dlog testPopup:D -f /tmp/mylog.txt
where is 'testPopup' your app tag
after this you could pull 'mylog.txt' file via connection explorer

and find your logs in log file after:
--------- beginning of /dev/log_system
--------- beginning of /dev/log_main

For more details  regarding 'dlog' see here:
https://developer.tizen.org/dev-guide/2.2.1/org.tizen.gettingstarted/html/dev_env/commands.htm
Alexey.

Eric Satkimbaev

Hello Alex,

Thank you for response!

I know about this approach, but I need to write log files directly from my app. I send my app to testers. They test it and if something wrong happens they need to send the logs to me by e-mail.

They can use approach suggested by you because they don’t have SDK installed.

Alex Dem

I did not check on pc without sdk but maybe it is possible to use sdb.exe and these command without installed sdk (you could use sdb pull command also).
But I think Samsung USB driver for Mobile should be installed anyway.

Eric Satkimbaev

They are field testers and there may be not PC near them. Also, using a command line tool like sdb may be too difficult for them. I have requirement to use the log files.

Alex Dem

Hi,
just fyi,try to look at /opt/var/log/dlog_main on device's file system.
But there are error and warnigs messages only (I did not find debug and info).
Alexey.

Alex Ashirov

Hi,

You can use “sdb dlog” command in order to copy a log’s content to a file. E.g.

sdb dlog -d -v time > c:\test.log

Please refer to the following link for more command line options:

https://developer.tizen.org/dev-guide/2.2.1/org.tizen.gettingstarted/html/dev_env/controlling_log_output_format.htm

Zoltan Puski

I just implemented yesterday my own "log to file" system, with a "send log in email" feature.
Yes, I also did it for the testers, as they found problems I cannot reproduce in Emulator/my Test Device/Remote Test Lab.
Yes, its a bit of duplicate work, as I cannot use the standard AppLog call, but at least this seems to work. I hope testers will be able to send me the log. I am very curious what goes differently on the Samsung Z than on my Test Device.

alan cubero

Yes, you can redirect the output of AppLog() to a file in Tizen.

Bekean Loinse

You can redirect the output of AppLog() to a file instead of the console in Tizen. To do this, you can use the freopen() function to redirect the stdout stream to a file. 

lopez1868 jennifer

So I want to log some sensor data in MCUXpresso at around 50 Hz. Some simple output format like CSV would be preferrable 

Emma Wilson

Thanks for the solution. I also faced the same issue.