473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

activities logging

hi all,

I want to implement logging for a mailinglist application.
the mailinglist will auto send out from a queuing table and user want to
know the updated status for how many emails have sent.

here is my ideas:
===================================
try
{
// sendemail code
SmtpMail.SmtpServer = "your mail server name goes here";
SmtpMail.Send(Message);
//logged into log file (xxx.log) with datetime
}
catch (Exception ex)
{
//logged description of ex.ToString() into log file (xxx.log) with
datetime
}
===================================
otherwise, can I use NSpring for my above requirement?
http://www.codeproject.com/csharp/nspring.asp

Thanks in advanced.
steambun


Nov 3 '05 #1
4 1489
CT
You mention a queuing table, is that a database table, a message queue or
soemthing completely different? If it is a database table, one option is to
have a trigger on the table that logs a entry to a log table when you remove
entries from the queuing table after sending it. Then you can produce a
report based on the entries in the queuing table and the entries in the log
table. That's one way, anyway...

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk

"Stanley Cheung" <st*****@starlabz.com> wrote in message
news:uE*************@TK2MSFTNGP09.phx.gbl...
hi all,

I want to implement logging for a mailinglist application.
the mailinglist will auto send out from a queuing table and user want to
know the updated status for how many emails have sent.

here is my ideas:
===================================
try
{
// sendemail code
SmtpMail.SmtpServer = "your mail server name goes here";
SmtpMail.Send(Message);
//logged into log file (xxx.log) with datetime
}
catch (Exception ex)
{
//logged description of ex.ToString() into log file (xxx.log) with
datetime
}
===================================
otherwise, can I use NSpring for my above requirement?
http://www.codeproject.com/csharp/nspring.asp

Thanks in advanced.
steambun

Nov 3 '05 #2
yes, it is database table,
the table has a flag to define the mail sent or not sent..

what do u means log table.... is txt/log file??

Thanks.

"CT" <ca******@spammersgoawayintegrasol.dk> ¦b¶l¥ó
news:u0**************@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
You mention a queuing table, is that a database table, a message queue or
soemthing completely different? If it is a database table, one option is to have a trigger on the table that logs a entry to a log table when you remove entries from the queuing table after sending it. Then you can produce a
report based on the entries in the queuing table and the entries in the log table. That's one way, anyway...

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk

"Stanley Cheung" <st*****@starlabz.com> wrote in message
news:uE*************@TK2MSFTNGP09.phx.gbl...
hi all,

I want to implement logging for a mailinglist application.
the mailinglist will auto send out from a queuing table and user want to
know the updated status for how many emails have sent.

here is my ideas:
===================================
try
{
// sendemail code
SmtpMail.SmtpServer = "your mail server name goes here";
SmtpMail.Send(Message);
//logged into log file (xxx.log) with datetime
}
catch (Exception ex)
{
//logged description of ex.ToString() into log file (xxx.log) with
datetime
}
===================================
otherwise, can I use NSpring for my above requirement?
http://www.codeproject.com/csharp/nspring.asp

Thanks in advanced.
steambun


Nov 3 '05 #3

Use the Trace classes

You can log to any /listener/ which can include a text file.

You can specify a trace file in the app.config or web.config file

Then you just do a Trace.WriteLine()

What I do for my logs is to create a static method, in a class
accessible everywhere in the namespace that does the logging.
Then I can call it at any point. And I include a DateTime.Now stamp.

log(string s)
{
Trace.WriteLine(DateTime.Now + " " + s);
}

I even use reflection for error logs to expose the calling method
automatically and write that to the log.
Stanley Cheung wrote:
hi all,

I want to implement logging for a mailinglist application.
the mailinglist will auto send out from a queuing table and user want to
know the updated status for how many emails have sent.

here is my ideas:
===================================
try
{
// sendemail code
SmtpMail.SmtpServer = "your mail server name goes here";
SmtpMail.Send(Message);
//logged into log file (xxx.log) with datetime
}
catch (Exception ex)
{
//logged description of ex.ToString() into log file (xxx.log) with
datetime
}
===================================
otherwise, can I use NSpring for my above requirement?
http://www.codeproject.com/csharp/nspring.asp

Thanks in advanced.
steambun

Nov 3 '05 #4
CT
Johns method is certainly a very valid way of doing this, but depending on
your reporting needs, if any, you might want to update the flag in the
table, once your message has been sent. A stored procedure would be a good
choice IMHO.
--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk

"Stanley Cheung" <st*****@starlabz.com> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
yes, it is database table,
the table has a flag to define the mail sent or not sent..

what do u means log table.... is txt/log file??

Thanks.

"CT" <ca******@spammersgoawayintegrasol.dk> ¦b¶l¥ó
news:u0**************@TK2MSFTNGP12.phx.gbl ¤¤¼¶¼g...
You mention a queuing table, is that a database table, a message queue or
soemthing completely different? If it is a database table, one option is

to
have a trigger on the table that logs a entry to a log table when you

remove
entries from the queuing table after sending it. Then you can produce a
report based on the entries in the queuing table and the entries in the

log
table. That's one way, anyway...

--
Carsten Thomsen
Communities - http://community.integratedsolutions.dk

"Stanley Cheung" <st*****@starlabz.com> wrote in message
news:uE*************@TK2MSFTNGP09.phx.gbl...
> hi all,
>
> I want to implement logging for a mailinglist application.
> the mailinglist will auto send out from a queuing table and user want
> to
> know the updated status for how many emails have sent.
>
> here is my ideas:
> ===================================
> try
> {
> // sendemail code
> SmtpMail.SmtpServer = "your mail server name goes here";
> SmtpMail.Send(Message);
> //logged into log file (xxx.log) with datetime
> }
> catch (Exception ex)
> {
> //logged description of ex.ToString() into log file (xxx.log) with
> datetime
> }
> ===================================
> otherwise, can I use NSpring for my above requirement?
> http://www.codeproject.com/csharp/nspring.asp
>
> Thanks in advanced.
> steambun
>
>
>
>



Nov 4 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jjesso | last post by:
I am trying to add a new logging level. logging.config.fileConfig("bengineLog.cfg") logging.CLIENT = logging.INFO + 1 logging.addLevelName( logging.CLIENT, 'CLIENT' ) logging.root.setLevel( )...
0
by: Karuppasamy | last post by:
H I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net I installed everything as per the Instructions given in the 'Development Using the Logging Block' ...
6
by: pmatos | last post by:
Hi all, I am trying to create a simple but efficient C++ logging class. I know there are lots of them out there but I want something simple and efficient. The number one requirement is the...
23
by: Rotem | last post by:
Hi, while working on something in my current project I have made several improvements to the logging package in Python, two of them are worth mentioning: 1. addition of a logging record field...
6
by: Burkhard Schultheis | last post by:
As I wrote last week, we have a problem with a DB2 V8 on Linux. Here is what is in db2diag.log during online backup: Starting a full database backup. 2004-04-01-02.33.54.760164 ...
0
by: Amratash | last post by:
Hi, I want to use any of the Logging site activity Format but at real time. How can I do this? Any Idea? Thanks. Regards, :-)Amratash
4
by: Stanley Cheung | last post by:
hi all, I want to implement logging for a mailinglist application. the mailinglist will auto send out from a queuing table and user want to know the updated status for how many emails have sent....
0
by: robert | last post by:
As more and more python packages are starting to use the bloomy (Java-ish) 'logging' module in a mood of responsibility and as I am not overly happy with the current "thickener" style of usage, I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.