Results 1 to 7 of 7

Thread: Best way to write logs

  1. #1

    Thread Starter
    Addicted Member SkyCoder's Avatar
    Join Date
    Oct 2003
    Location
    Moon Crater 25
    Posts
    183

    Best way to write logs

    I’m a developer on software used in the property industry. We are busy revising system security etc. We are considering to write log files for certain high risk processes. What is the best way of writing logs? In my opinion I feel its maybe worth our while to write to log tables in the existing db instead of creating text file logs. I realise that this would contribute to the size of the db,but there are ways & means to archive the information if necessary. Another advantage is that reporting/Statistic/Search interfaces can much easier be implemented from a relational db structure than a text file.

    Please give me your view on this as there might be important factors that I’m overlooking.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Best way to write logs

    SkyCoder,

    If security is an issue then the dtabase is the way to go.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Best way to write logs

    I agree with randem. Db tables are the way to go for this issue and that is what we use. I'm a commerical developer in the Insurance industry and we use Db tables for everything.

    We use to them to store error trapped runtime errors and we use them to store personal application preferences (we used to use the registry for this, but many companies these days are rolling out computers to their employees with the registry locked down so we had to devise another method for storing user configurable preferences).

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Best way to write logs

    I also agree...

    User preferences, user logs - tracking time in/time out of appliations - where they connected from - number of rows affected...

    We do everything with tables. If we are going to load data from a text file into our database, we first load it into a "staging" table - we then process that staging data into transactions in the real data tables.

    If we are going to produce W2's or 1099's or DIRECT DEPOSIT data for a bank, we first load the data into "fixed width column" tables - then simply create text files from that.

    The database has a complete history of every process in and process out.

    The only thing we don't store in the DB are images of students (for example) - we store the path to the filename. We drew the line at that point...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Best way to write logs

    Quote Originally Posted by szlamany
    The only thing we don't store in the DB are images of students (for example) - we store the path to the filename. We drew the line at that point...
    That is interesting. We do store accident scene photos (for those of you who don't know, I am a commerical developer in the Risk Management industry), and scanned images of police reports as well as a varity of other scanned documents relating to a claim.

    As a point of curiosity, why did you decide not to store student photos?

  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Best way to write logs

    Quote Originally Posted by Hack
    As a point of curiosity, why did you decide not to store student photos?
    They change every year for one thing...

    Also - with a 20 building WAN, we can chose to put them on a server local to the building and have the PATH in the DATABASE know that each building is on a different server...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Best way to write logs

    Quote Originally Posted by szlamany
    They change every year for one thing...
    Da...that makes sense...you are dealing with students after all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width