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

  • Home
  • SEARCH
  • 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 288041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:46:48+00:00 2026-05-12T05:46:48+00:00

I have my log file working, but I get extraneous info on each line

  • 0

I have my log file working, but I get extraneous info on each line like “29 Query”, and I can’t tell, but it looks like the queries logged are the interpretation of how MySQL treats each query internally. Is there a way to automatically log each query as they were executed by the application without any additional information added to the log by MySQL? Thanks!

EDIT:

As a part of offering the bounty, let me explain my situation. We’re using Magento Commerce, which has an EAV database architecture. Tracking anything down, and where it is stored is an absolute nightmare. My thought was to insert a product into the database in the application, and then log every query that was executed during that process. This worked well, but the logs have a ton of other cruft around the queries. I really do just want something like this:

1.) SELECT * FROM <TABLE>;
2.) UPDATE <TABLE> SET <VALUE> = <VALUE>;
3.) ...
4.) ...

Something simple that tells me what was executed so that I don’t have to go sifting through controllers and models to try and get all this. I don’t need dates, times, line numbers or anything extra.

  • 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-05-12T05:46:48+00:00Added an answer on May 12, 2026 at 5:46 am

    To enable full Log Query add the following to your my.cnf:

    log=/var/log/mysqldquery.log
    

    The above will log all queries to the log file.

    Don’t forgot to restart mysql service after making changes in my.cnf file.

    Example output from actions via SequelPro (mac client):

    090721 11:06:45      51 Query       ALTER TABLE `test` ADD `name` varchar(10) DEFAULT NULL
                         51 Query       SHOW COLUMNS FROM `test`
                         51 Query       SHOW INDEX FROM `test`
    090721 11:06:57      51 Query       SHOW COLUMNS FROM `test`
                         51 Query       UPDATE `test` SET `id`='1', `name`='test' WHERE `id` = '1' AND `name` IS NULL LIMIT 1
                         51 Query       SELECT * FROM `test` LIMIT 0,100
                         51 Query       SELECT COUNT(1) FROM `test`   
    090721 11:07:00      51 Query       UPDATE `test` SET `id`='2', `name`='test' WHERE `id` = '2' AND `name` IS NULL LIMIT 1
                         51 Query       SELECT * FROM `test` LIMIT 0,100
                         51 Query       SELECT COUNT(1) FROM `test`
    

    On *NIX based systems you can use grep to start

    grep 'SELECT\|INSERT\|UPDATE' querylog.log
    

    Or get more tricky and start doing things like:

    grep 'SELECT\|INSERT\|UPDATE' querylog.log | awk '{$1="";$2="";print}'
    

    This would give you something like this, not perfect but closer:

      51 Query UPDATE `test` SET `id`='2', `name`='test' WHERE `id` = '2' AND `name` IS NULL LIMIT 1
      SELECT * FROM `test` LIMIT 0,100
      SELECT COUNT(1) FROM `test`
      51 Query INSERT INTO `test` (`id`,`name`) VALUES ('3','testing')
      SELECT * FROM `test` LIMIT 0,100
      SELECT COUNT(1) FROM `test`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with a log file and I have a method which is
I have a log.txt file on the root of my application. I would like
I'm working with a WCF web service project and using log4net, but can't get
I have several log files of events (one event per line). The logs can
I have a log file that I'm trying to append data to the end
I have a log file that I am reading to a string public static
I have a log file in SqlServer that stores the time an application started,
I have a log file containing statistics from different servers. I am separating the
Lets say we have a log file (preferably a txt file) available in the
I have a transaction log file in CSV format that I want use to

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.