Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8104087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:44:12+00:00 2026-06-05T23:44:12+00:00

I work at an eCommerce company. Our DBA recently told me that using SQL

  • 0

I work at an eCommerce company. Our DBA recently told me that using SQL for logging is a bad practice, and recommended a flat file and grepping instead. I had never heard that logging in SQL was a bad practice before and I don’t find anything online that confirms this.

When I say logging, I mean logging user actions like signing in, changing account information, etc, and data like their user agent, ip address, account id, and event information.

While it would lead to a lot of rows over time, it makes it extremely easy to search if there is an issue with a customer.

Is logging in SQL a bad practice, and is it preferable to log to a file?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:44:13+00:00Added an answer on June 5, 2026 at 11:44 pm

    The only problem with doing that is increased load on the database and increased disk space. Apart from that there is nothing preventing you from doing that. Actually, it is very convenient to be able to query your logs and to have them consistent and easy to backup.

    You can put a little more structure into your logs with SQL compared to flat files. For example you could have the following columns:

    • ID
    • DateTime
    • EventCode
    • Message
    • MachineName
    • HttpRequestID
    • UserName
    • UserID
    • AdditionalDataXML: a queryable XML column with structured data about the event

    Very convenient. I recommend it.

    Why does your DBA resist? Well, he has no downside talking you out of it. He doesn’t get the benefit of having a nice logging table. But he’d have to maintain it. The incentives are asymmetrical.

    As a mitigation you could have a nightly TRUNCATE TABLE clear out the log items. Maybe export them before doing that (bcp.exe).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job
At work our end-users are on Windows XP and using Outlook Express. Whenever a
I currently work for a large company and I design for their high-traffic ecommerce
I'm working on an ecommerce website for my work that gives me articles that
I work for a small web development company (only 2 to 3 developers) that
I work with unordered_set . Here it's written that it has a reserve function
I am developing a Ecommerce website by using version Magento 1.6. I need to
I am using NHibernate for an ecommerce site and am having difficulty getting what
We're developing a new eCommerce website and are using NHibernate for the first time.
Building a website using a PHP based Ecommerce product Magento. The problem I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.