Version 3 (modified by Art Rhyno, 13 years ago) (diff)


Production postgres logs for the last few days are on polaris:

  uowadmin@polaris:/var/log/postgresql$ ls -l
  total 33380
  -rw-r----- 1 postgres adm  2932201 2009-08-31 11:55 postgresql-8.3-main.log
  -rw-r----- 1 postgres adm 22720479 2009-08-30 06:25 postgresql-8.3-main.log.1
  -rw-r----- 1 postgres adm   564383 2009-06-28 06:25 postgresql-8.3-main.log.10.gz

You can use sudo to hunt down a problem in a particular timeframe:

  sudo grep '2009-08-27' postgresql-8.3-main.log.1 | more
  sudo grep '2009-08-27' postgresql-8.3-main.log.1 > ~/errors.txt

The main gathering point for the logs is starburst. There is a problem with wildcard expansion for sudo commands so you need to use the format shown if you want wildcards:

  sudo ls -l /var/log/remote/prod/2009/08/27
  sudo sh -c "grep 27T17 /var/log/remote/prod/2009/08/27/*" | more

So in the example above, we are looking for error messages associated with 5 PM (T17) on Aug. 27, 2009