Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Nov 16, 2018 4:15 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Help with system log or a simple log file
PostPosted: Thu May 03, 2012 11:40 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Hello all,
My first endeavor into linux. I am testing with Ubuntu 12.04 64bit. For error trapping, I use the following code, which appears to work.

Exception e as RuntimeException
System.DebugLog( "Unknown exception in: clsTCP.Connected" )
MsgBox("An exception in: clsTCP.Connected " + e.Type + " .")



I never see any log entries in /var/log/syslog

Is this the appropriate place I should expect to see the log? Is there a better method to both place logged errors and other types of logs in a linux environment?

Any ideas or suggestions would be appreciated.

Thanks
Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Fri May 04, 2012 12:06 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
Under Linux, System.DebugLog is printed to your application's StdError stream, NOT to any system-level logs.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Fri May 04, 2012 12:22 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Hello CharronnO and thank you for your response!

I am sorry, but I do not follow your statement of "application's StdError stream". Perhaps you can suggest the most appropriate method of outputting to a log file, or other text file (say in the same folder as the application)?

Thank you again!
Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Fri May 04, 2012 12:31 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
There are three standard I/O streams to *nix applications and they are deeply rooted in the command-line interface. StdIn, or Standard Input, is from the keyboard, StdOut or Standard Output is printed to the command-line screen, and StdErr or Standard Error is usually also routed to the command-line screen. If your app isn't started from an active command-line session (e.g. you double-clicked an icon in the GUI) then the StdErr messages are essentially discarded.

Image

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Fri May 04, 2012 1:06 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
This is started as a Daemon.

Can you suggest a way to write to a text file?

Thanks again.
Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Fri May 04, 2012 1:33 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
You can redirect the StdErr to a file at runtime by using 2>:

Quote:
User@Host$./MyApplication 2> ~/MyApp/logs/123.log

This may or may not be practical for your particular case.

You could also write your own logging module with the TextOutputStream class.

If you're looking to log things in the system log, then this looks like a good place to start.

_________________
Boredom Software


Last edited by charonn0 on Fri May 04, 2012 1:37 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Fri May 04, 2012 1:35 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Thank you!

I appreciate the direction.

Tim


Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Mon May 07, 2012 12:22 pm 
Offline

Joined: Fri Nov 16, 2007 10:18 pm
Posts: 195
Location: Portland, OR
This may be more useful to you:

http://docs.realsoftware.com/index.php/System.Log

_________________
Windows: Win7 64bit sp1, Vista 32bit sp2, WinXP 32bit SP3
Linux: RH EL6
Mac: Died in 2011 and took 2 months to notice.

RealStudio: 2012r2


Top
 Profile  
Reply with quote  
 Post subject: Re: Help with system log or a simple log file
PostPosted: Mon May 07, 2012 12:39 pm 
Offline

Joined: Sat Dec 04, 2010 9:14 pm
Posts: 918
Thanks Bob,
Tim


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group