Questions tagged [logging]

A time-ordered, human-readable archive of activity. For questions about the database transaction log, use the transaction-log tag instead.

Filter by
Sorted by
Tagged with
1 vote
2 answers
94 views

How can I save the job result to a file?

I created a job in SQL Server. This job runs the following statement at regular intervals: Select NationalIDNumber from HumanResources.Employee where BusinessEntityID = '1' I want to save the result ...
Merve's user avatar
  • 55
0 votes
1 answer
24 views

How can i prevent "STATEMENT: ..." logs written by system(?) everytime when my FDW calls elog() with LOG_SERVER_ONLY?

I'm making a FDW (Foreign Data Wrapper) in PostgreSQL for myself using C. I want to write a log but not to display when some error occures. so i thought elog & LOG_SERVER_ONLY is good way but when ...
yasoo7964's user avatar
0 votes
0 answers
19 views

MaySQL InnoDB cluster log fill on one server

in my mysqld.cnf file, I enabled logging via the following general_log = 1 general_log_file = /var/log/mysql/mysql.log It is a three-node cluster. I can see all the queries in the log ...
orddie's user avatar
  • 1
0 votes
1 answer
163 views

Postgres 11 log all statements not working as expected

I am trying to track down a row delete that is happening somewhere in a huge and sprawling application. I know that something deleted a row in an important DB table, and I have narrowed down when the ...
chrestomanci's user avatar
0 votes
0 answers
35 views

how can I create a Query log can be enabled for Analysis Services tabular mode instances?

I know that "Query log can be enabled for Analysis Services multidimensional mode instances only. Query log cannot be enabled for tabular mode instances." But is there a way I can do query ...
WhoIsNotActive's user avatar
0 votes
1 answer
55 views

Logging not working for PostgreSQL 14 on Windows

I have edited the postgresql.conf file and set logging parameters as follows. However, after I restart and look a the logging_collector value, it's set to off and logging is not working: ...
Dean Richards's user avatar
1 vote
0 answers
74 views

How to log operations only in one specific table in PostgreSQL

I have one very important table in psql db. I would like to log every operation possible to this table: select, insert, update, etc. How can I achieve this? Thank you.
Dmitriy Berkutov's user avatar
0 votes
0 answers
431 views

Postgresql stops logging in docker

I am using postgres 12.12 via the official docker image and it sometimes stops logging, seemingly randomly. I am trying to figure out what could be causing this. I'm running it on my development ...
Laurent S's user avatar
  • 101
0 votes
2 answers
128 views

Separate tables for logging?

I would like to log new products, updates to products and deletions of products (and the same for other schemata [customers, locations etc]). Would it be best to have a separate table (e.g. ProductLog,...
Basil's user avatar
  • 131
0 votes
1 answer
346 views

MySQL 8 disk usage always grow

MySQL's disk space usage increases as time goes on, but drops all at once when I restart MySQL. After much investigation I think I have found the cause of the problem, it seems that MySQL is writing ...
rhiezcnl's user avatar
1 vote
0 answers
209 views

How to direct psql errors to powershell log file?

I'm running a powershell script on a windows system. The script includes psql commands to run SQL on a postgres database. Most stuff gets correctly recorded in the powershell log file, EXCEPT for psql ...
ConanTheGerbil's user avatar
0 votes
1 answer
559 views

Logging in error states in Postgres transactions

I'm currently working on rebuilding some SQL Server stored procedures in Postgres, but I have the following hangup CREATE OR REPLACE PROCEDURE public.math_proc () LANGUAGE plpgsql AS $$ BEGIN ...
Rushabh Mehta's user avatar
1 vote
2 answers
292 views

What is the fastest way to log the Input and Output parameters when executing Stored Procedure

Normally i will log this information at the end of each SP. The syntax looks like this. DECLARE @SPContent nvarchar(4000)= ( SELECT @ServiceID [ServiceID], @AccountID [...
Tạ Đức's user avatar
1 vote
3 answers
264 views

Find which IP added a specific record to a table in SQL Server

Let's say I have an SQL Server running on Azure and multiple applications add records to it. The problem is that some records come from an unknown application. Is there a nice way of finding which IP ...
Dimitrios Arampatzis's user avatar
1 vote
2 answers
57 views

How do I enable DML logging in Cassandra 2.1?

How to enable logging DML(inserts, updates), DDL (alter, create) operations in cassandra version 2.1? nodetool getlogginglevels Logger Name Log Level ROOT ...
Dennis's user avatar
  • 11
0 votes
1 answer
720 views

How to permanetly turn of transaction logging for specific table in Db2?

In our company we are merging two systems together. Data are required to be moved from Microsoft SQL Server 2016 source database into Db2 v11.5 target database. In production environment this is going ...
folow's user avatar
  • 339
0 votes
0 answers
130 views

PG 13.6 : Data corruption error not being sent to syslog

This morning I noticed this error in my PG CSV log file. 2022-05-25 23:59:17.776 JST,,,117110,,628cf2c5.1c976,1,,2022-05-25 23:59:17 JST,9/611296,0,ERROR,XX001,"uncommitted xmin 16395356 from ...
Abhishek B's user avatar
0 votes
0 answers
118 views

How can I see the queries executed on day x? (So I can find the DB change that is impacting performance.)

Since Day X (which is inconveniently just outside my DB recovery plan), I have been experiencing a significant performance degredation on an overnight process that runs Stored Procedure A, executed ...
smallnorthumbrianvillage's user avatar
1 vote
0 answers
19 views

PostgreSQL - is it possible to log to separate files per database? [duplicate]

I have multiple databases inside a single PostgreSQL instance. Is there some way to get it to use a separate log file for each database ?
Crashmeister's user avatar
1 vote
4 answers
1k views

PostgreSQL logging: Statements splits into multiple lines

In PostgreSQL v10 and above, I activated the logging of the statements using the extension pg_stat_statements. My configuration: logging_collector = on log_line_prefix = '%t [%p]: [%l-1] db=%d,user=%u,...
dcop7's user avatar
  • 29
0 votes
1 answer
246 views

What do these weird errors logged mean?

Today, I got these errors logged for the first time: stats_timestamp 2022-01-16 10:58:25.625142+01 is later than collector's time 2022-01-16 10:58:23.356175+01 for database 0 statistics collector's ...
Klappoklang's user avatar
0 votes
1 answer
952 views

General Questions about using MySQL with Docker, logging options

I have a number of questions about logging / backup strategies when using MySQL with Docker specifically and also just general questions. The particular scenario is MySQL DB's for a small medical ...
SScotti's user avatar
  • 103
0 votes
2 answers
314 views

How to resolve INSERT contention in Azure SQL Database?

I'm working with an Azure SQL Database that has a very hot logging table. Any time a row in any other table is inserted, updated, or deleted, the web application writes a row to this logging table. ...
Mark Freeman's user avatar
  • 2,171
1 vote
1 answer
364 views

correlating postgres LOG and DETAIL loglines

We're logging slow running queries in PG (on AWS RDS) with log_min_duration_statement along with log_error_verbosity = default so we get DETAIL lines, because our app's libraries uses prepared ...
Joe's user avatar
  • 161
2 votes
1 answer
137 views

Why does SQL Server Trace Flag 715 behave differently from the TABLOCK query hint?

It's my understanding, based on numerous sources (including this one: https://techcommunity.microsoft.com/t5/sql-server/migrating-sap-workloads-to-sql-server-just-got-2-5x-faster/ba-p/384910) that SQL ...
Mike S's user avatar
  • 135
1 vote
1 answer
200 views

Writing custom server logs in Postgres

We have set up a Postgres instance that is writing logs directly to AWS CloudWatch. We would like to be able to write our own logs for the purpose of automated processing. Unfortunately our current ...
Marek Puchalski's user avatar
0 votes
0 answers
121 views

Sql Error Message ID 3013 & 4305 for Standby / Read-Only database that we use for import data heavily

Sorry. I am not a DBA, but a SQL Developer, so I am trying to get some general support/feedback on my case (and when I Googled the issue, remedy seems so scattered so I decided to post here). I got ...
Java's user avatar
  • 223
0 votes
1 answer
309 views

How do I make PostgreSQL log the file path and line number of the errors? (If it's even possible at all.)

My postgresql.conf contains this: log_destination = 'csvlog' logging_collector = on log_directory = 'C:\\Users\\John Doe\\Documents\\PostgreSQL logs' log_filename = 'PG_%Y-%m-%d_%H;%M;%S' ...
user15080516's user avatar
1 vote
2 answers
879 views

Auto logging / tracking records changes at MS SQL [duplicate]

how can I set automatic recording all changes that were done at tables records (Updates) and to get some info / logging summery? thanks
Dmitri Michlin's user avatar
0 votes
1 answer
95 views

Log to disk all queries that waited for a lock over a period of time

I manage a mariadb 10.4.17 server, and I'm having the issues with a table, it seems randomly I will get lots of queries "waiting for metadata lock" causing my entire database to be useless. ...
Freedo's user avatar
  • 188
0 votes
2 answers
2k views

How to log multiple invoke-sqlcmd verbose outputs into single log file along with showing/not showing them through flag into prowershell prompt

Lets say we have multiple invoke-sqlcmd statements like below: invoke-sqlcmd -Query "PRINT 'Hello World 1'" -ServerInstance Server\SQL2017 -Database abc -Verbose invoke-sqlcmd -Query "...
Murali Dhar Darshan's user avatar
-2 votes
2 answers
447 views

How to find out WHERE a PG error/warning/log happened?

I have PostgreSQL CSV-log its "errors" according to this structure: https://www.postgresql.org/docs/12/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG It doesn't include the file ...
Reef's user avatar
  • 1
0 votes
1 answer
455 views

Configuring 2017 SQL Server SSISDB Server-wide Default Logging Level does not seem to work

Using SSMS, I have changed the SSIS Catalog Logging Level from Basic to Performance to a Custom Logging Level in a 2017 SQL Server Instance and then I run the report: "All Executions". It ...
steveb's user avatar
  • 33
-1 votes
1 answer
94 views

How do I log the actual script's name in csvlog? [duplicate]

I have PostgreSQL CSV-log its errors according to this structure: https://www.postgresql.org/docs/12/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG Sadly, from what I can tell, it neither ...
Ollifant's user avatar
-2 votes
1 answer
3k views

What should I do about PostgreSQL logging so much "weird noise" in its own log?

PostgreSQL 12.4 on Windows 10 Pro 2004. With the default configuration file, I start PostgreSQL with pg_ctl and the "-l PostgreSQL.txt" option. It logs to that file. Looking in it, I'm ...
Orbelin's user avatar
-1 votes
2 answers
6k views

How do I get access logs from SQL Server database [closed]

I am in the process of carrying out system reviews for some systems powered by SQL Server. IS there a way of getting the access logs to these systems databases spanning a period of 6 months starting ...
user avatar
1 vote
2 answers
2k views

How can I force the MySQL client to output to stdout or a log file when importing a SQL file?

Let's say I am importing a small SQL file using the MySQL client like so: mysql < 10k-file.sql The mysql client does not output anything. How can I force it to show how many rows are affected for ...
bteo's user avatar
  • 111
1 vote
2 answers
324 views

Non-deterministic functions and row-based binary logging (MySQL)

Newbie questions. I'm working on a MySQL project that will use only row-level binary logging. There will be no replication. Since logging is row-level, does it even matter if a function is ...
Mike Blyth's user avatar
0 votes
1 answer
31 views

Cannot get rid of creation of mysql.log

I have these settings in my.cnf: [mysqld] ... disable_log_bin general-log = false general_log_file = /var/log/mysql/mysqld.general.log long_query_time = 1 slow_query_log = false ...
Peter VARGA's user avatar
1 vote
0 answers
78 views

Best practices for users credentials [closed]

I am designing a C# client to connect to a MySQL DB and am having second thoughts on my design. The users have credentials in order login in the C# client, so now it is designed like this: 1 - the C# ...
Felipe's user avatar
  • 19
1 vote
0 answers
333 views

SQL Server 2017, XEvent: sql_text IS NOT NULL

I'm attempting to use XEvents to find out which queries are causing my templog.ldf file to grow in size. I'm getting events, but I see the sizes of the files haven't changed, and that the sql_text ...
Black Dynamite's user avatar
0 votes
1 answer
35 views

Massive Transaction Logs - what are my options?

I have a fairly crazy scenario where I am processing ~250 million inserts and 250 million deletes for a table that contains data that is only relevant for the moments that it is in the database. Once ...
Michael Troyer's user avatar
0 votes
0 answers
527 views

SQL Server database in Recovery mode, how to troubleshoot?

I have a SAP instance running with a 'SQL Server' database that just recently got into recovery mode without a clear reason (no backup or restore was executed). We noticed that the storage for logs (...
comebackhere's user avatar
-1 votes
1 answer
107 views

Login failed for user 'sa' State: 8, in short time

I have setup SQL Server on server Customer. Recently, log files in SQL Server increase continuously. I checked the content of those logs - see here: In my application I use an account for connecting ...
user avatar
0 votes
2 answers
715 views

Logging user's id with the query he executed

So, I am trying to log not just the postgres user but his ID from my table (for example) Person (person_id) when he calls functions. So far, from what I can tell I can get almost every information I ...
Chessbrain's user avatar
  • 1,183
3 votes
1 answer
3k views

What is the performance cost of enabling "log_lock_waits" on Postgres?

I am trying to understand what is the performance cost of enabling log_lock_waits on Postgres. As per this documentation, while log_lock_waits = on: Controls whether a log message is produced when ...
Sam.E's user avatar
  • 85
1 vote
0 answers
294 views

How to switch off statement logging from a trigger in PostgreSQL

I just spent ages working out how to record messages from triggers into a log file. And then nearly as long working out where the logs files were being created. Anyway, I added this line to my ...
ConanTheGerbil's user avatar
1 vote
1 answer
1k views

Disable log ERROR: duplicate key value violates unique constraint

Running Postgresql in a better ask for forgiveness than permission mode during the inserts. Works great, only problem: The logs are flooded with the following message duplicate key value violates ...
gies0r's user avatar
  • 135
0 votes
0 answers
67 views

How to Track Table Usage

I need to track usage for 1 table, and log how this table is accessed (select, insert, etc.) and by which logins What is the proper way to do it using SQL Server Audit and Extended Events ? If there ...
Aleksey Vitsko's user avatar
0 votes
1 answer
231 views

how can I divide log files for specific DB queries?

Currently my db has a couple of triggers for some (not all) tables that get executed when a specific number of columns has been updated. I keep track if the triggers for those rows on a boolean column ...
Eiron's user avatar
  • 103