Solved

writing exceptions to a log file

Posted on 2004-10-19
1
162 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 158
Find Visual Studio Tools 2 113
Outlook 13 43
find Speed using GPS latitude & longitude 4 46
  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 …
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

831 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