Solved

writing exceptions to a log file

Posted on 2004-10-19
1
161 Views
Last Modified: 2010-04-01
I would like to catch any exception in my code and write it to a log file. My program will be running as a cron job every night and if an error or exception happens I need to be able to tell exactly where and since it's an automatic process I figure it would make sense to write errors or exceptions to a log file. Can someone write sample code on how to catch exceptions and write it to a file? I'm using visual c++ 6.0 and my project is win32 console project. It would be preferable to show a line of code (where it happened) and name of file, and time it happened.
0
Comment
Question by:healingtao
1 Comment
 
LVL 12

Accepted Solution

by:
OnegaZhang earned 500 total points
ID: 12355199
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question