Writing log files from code, using SMTP

Discussion in 'Site Programming, Development and Design' started by ianmc, Jun 12, 2010.

  1. Hi Chaps,

    I would like to append data to log files from my code, in this post frankc says it is possible to write file to your own webspace>
    I did a little test and the c# Directory.GetCurrentDirectory() method gave a permissions error so I set the trust level to Full in my web.config file and then it works but the path it returns looks a bit 'system ish'
    I would normally check to see the path of the running assembly and presume that to be the root of my webspace.

    I don't want to start stomping files all over your nice system so I haven't even tried to write a file yet.
    What would be your preferred method of us coders writing and appending to log files in our webspace?
    Would you have a simple example in C# ?

    I currently send an email from my code using a gmail SMTP account but in this post Ray says SMTP is disabled and only allowed through your own SMTP server>
    Does this mean that my way of sending emails might suddenly stop working?

    I want to make sure I'm playing by the rules and don't get any unwelcome surprises.

    Best Regards

    Last edited by a moderator: Oct 14, 2015
  2. Ok, in the control panel I found the Path To Root so I should be able to use this.

    Another simple question is that when I go into the site manager I see the icon for Stats but when I click on it all I see is that SmarterStats are enabled, I don't actually see any stats.

    It's me I know it is but what am I doing wrong here?

    Is it possible to be notified by email upon replies to forum posts?

  3. Ok, figured out the logs, you have to point a web browser to http://stats01.Winhost.com
    and login with your ftp login.

    Silly thing for me to miss really as it does say Stats URL Location: http://stats01.Winhost.com in the control panel when you click on the Stats icon but just to let you know how thick your users can be I didn't figure this out before I'd downloaded the massive SmarterStats application from smartertools.com so it might be an idea to put a 'You view your stats by pointing a web browser to this site' bit of text somewhere :)

    Still once you know, you know.

    Last edited by a moderator: Oct 14, 2015
  4. Glad you got the issue sorted out.

    Yes. When you start the thread there is an option somewhere in all the junk under the text entry box:
    Thread Subscription
    Notification Type:​
    You can set that to email you when there is a response.

    You can also make that the default behavior in your cp under:
    Settings & Options
    Edit Options​
    Last edited: Oct 14, 2015

Share This Page