PDA

View Full Version : Want to stop Postgre from creating those large log files, here's how



mksmipalla
03-18-2009, 11:16 PM
I have gotten a lot of help on this forum with Holdem Manager and with PostgreSQL so I thought I would try to give some help and show how to keep PostgreSQL from writing the logs that take up so much space. I have included screen shots to help with the descriptions.

If you are new to Holdem Manager and to using PostgreSQL there is a folder inside the PostgreSQL folder called pg_log. Postgre writes logs in this folder while you are using Holdem Manager. These logs can cause the pg_log folder to get quite large and for some, even though I have not had this problem, can cause Holdem Manager to lag. These logs are used for trouble shooting Postgre problems and for programing and not needed by us. The logs in this folder have no player info or stats or any of your poker database. They just take up hard drive space. You can just delete everything in the folder every few days or weekly, but this way you never have to think about it. If for some reason you need to use these logs for a Postgre problem this is easily undone.


I am using Postgre 8.3, but this works if you are using 8.2


First you will want to go to c:>Program Files>PostgreSQL>8.3>data (for postgre 8.2 it will be 8.2>data)

Open the pg_log folder and if there are logs in it just delete all of them. Just the logs not the whole pg_log folder. Now close that folder.

You will need to edit your postgresql.conf folder. You can see it here.

http://img27.imageshack.us/img27/4586/postgresconfigfile.jpg

Now just open your windows notepad. Now click on the postgresql.conf folder and drag and drop it into the notepad window. You will now be able to read the files and edit it.

http://img27.imageshack.us/img27/1097/postinnotepad.jpg

You will now need to scroll down until you see:logging_collector = on
(If you are using 8.2 you may see: redirect_stderr = on)

Just change this to off. (logging_collector = off) like this.

http://img27.imageshack.us/img27/7568/logoff.jpg

Now just save the change in the notepad like this.

http://img27.imageshack.us/img27/1412/savenotepad.jpg

Now just close the notepad window and close your PostgreSQL folder. You will now have to restart your computer for the change to take effect.

Next time you use Holdem Manager to play just check the pg_log folder, when your done playing, and it should still be empty. That's it. Not to hard.

pellshek
03-19-2009, 01:42 PM
Thank you for this mksmipalla. I am not a computer person, so could someone from HEM confirm this post is accurate before I do it?

Also, am I right in thinking I can delete all the contents in PSQL>8.3>data>pc_log? What about "pc_clog"? Any other unneeded areas I can delete?

Once again, thanks to OP for this thread.

mksmipalla
03-19-2009, 07:01 PM
No problem pellshek, glad to help. Dont clear the pc_log folder. I don't know what the is used for. Only clear the pg_log folder.

PCP Poker
03-19-2009, 07:40 PM
Now this is what I like to see. Way to share the info man. We need more posters like this.

pellshek
03-19-2009, 07:44 PM
Cool, thanks mksmipalla.

.........

Roy/Morney/Mike - you guys should really highlight this issue more. It certainly belongs in the FAQ's in the Maintaining HEM section IMO. I had over 10 GIGS of these logs!! I couldn't believe it, and wasn't even aware it was there before seeing a post about it on 2+2 on Monday. I know you are all up to your eyes every day with problems and upgrades and whatnot, but I think this is important enough to take some time updating the FAQ's.

morny
03-19-2009, 07:58 PM
No Probs, Thanks for posting and ill add this to the FAQs tommorrow

mksmipalla
03-20-2009, 03:08 PM
Now this is what I like to see. Way to share the info man. We need more posters like this.

Thanks PCP. This can make a big difference if you have never cleared that folder before.

morny
03-20-2009, 03:27 PM
FAQ created http://www.holdemmanager.net/faq/afmviewfaq.aspx?faqid=185

bobbyperu
12-19-2009, 11:13 AM
thanks a lot, very helpful

praetor
12-22-2009, 02:51 AM
lol I had 28 gigs of logs. thanks

MacUser
01-16-2010, 08:13 PM
TY for this info. Just setting up a new laptop (w Windows 7) and it won't let me save the changes in notepad, saves I don't have permission to save in this location and to contact administrator. Any ideas anyone?

EDIT: Okay, I found elsewhere that you should just save the file elsewhere and copy it where it needs to be. So I did that, and now in the postgres 'data' folder I two postgresql.con files. Under 'type', the original says 'conF file' and the revised one says 'text' file. If I just delete the original will postgres use the 'text' file?

netsrak
01-17-2010, 07:25 AM
No that will not work.
You need to delete the original file (or rename it as backup).
Then you need to rename your txt file to the original filename.

Notepad unfortunately automatically adds a .txt extension when editing a file.

After the renaming you need to restart your postgresql service (or reboot your computer).

runhot
01-26-2010, 11:23 AM
im trying to turn the logging off, and i'm getting an error while trying to save in notepad that says "Access is denied".

This is when im trying to save the edited .conf file.

i have also tried making a copy of the file, naming it, changing the extension to txt, then make the edit, then try to save-- and its still saying 'access denied'

ive never seen this before.

netsrak
01-26-2010, 03:15 PM
stop postgresql service,
rename the original file,
rename the copy to the original file
and restart postgresql.

You need Administrator rights to do this.

111AYKY111
02-24-2010, 10:32 PM
does this work for 8.4 as well?

netsrak
02-25-2010, 10:30 AM
It should work, check the comments in the conf files

Polar_Bears
04-23-2010, 04:02 PM
I don't understand....why are we doing this?? Log files aren't just created for no reason....what exactly am I deleting here? What could I possibly lose down the road or cause by deleting these log files and changing the switch to off in the postgresql.conf file?

My postgresql.conf file is 18 gigs big.

_Loki_
04-23-2010, 05:42 PM
the log files are useful maybe for troubleshooting purposes should you have a problem with postgreSQL etc, but if you get troubles old logs aren't going to help

FAQ - Hold'em Manager Poker Tracking Software :: Large Log Files (http://faq.holdemmanager.com/questions/85/Large+Log+Files)

If you don't like the idea just delete the logs but keep logging active

Kevin86
04-30-2010, 10:53 PM
When I try to save the changes I made, it says' make sure the path is correct...

So for some reason I can't seem to save it

pls assist.

_Loki_
04-30-2010, 11:11 PM
hi kevin - The file you are trying to save...
It has something to do with log files ?
what instructions are you following ?

what is the file called ? (give the full name)
where is it ? (what's the name of the folder it's in ?)

I'm asking because some files\folders have similar names - easy to make a mistake

pfsrs4
06-15-2010, 05:06 PM
What about this folder C:\Program Files\PostgreSQL\8.3\data\base. This one is almost 12G . Can i delete this one?

Thanks

morny
06-15-2010, 07:41 PM
DONT DELETE ANYTHING IN THERE - It will corrupt your database beyond repair:)

pfsrs4
06-15-2010, 07:51 PM
understood, thanks Morny

St3v3k4hn
06-24-2010, 02:42 PM
Is this still an issue with the latest postgres (8.4)? I looked and my log file was less than 1k...

netsrak
06-25-2010, 05:47 AM
I'm not sure whether the different Postgresql versions are configured differently. But if your logs folder is nearly empty i assume its ok.

microbob
07-13-2010, 04:01 AM
bumping this thread for awesomeness.

Had done some of the steps in the performance increase thread but wasn't getting any results really. I thought I had logging turned off already but I guess not. I had 1800 logs in there that I deleted. And right away my computer's performance with HUD on is hugely improved. What a difference. Hallelujah.

Encourage everyone to look into this on your computer if you have never done so. Screw all that bit about clearing the database or purging the HH's, etc (well, I guess you don't want to completely forget that stuff...but it didn't seem to make any difference for me)....this step is the real deal and seems to have really helped my HUD.

I had gotten to the point where all the little half-second delays were bugging me enough while 20+ tabling that I just stopped playing with the HUD completely for a little while.

spoutnic
08-18-2010, 01:37 AM
hi kevin - The file you are trying to save...
It has something to do with log files ?
what instructions are you following ?

what is the file called ? (give the full name)
where is it ? (what's the name of the folder it's in ?)

I'm asking because some files\folders have similar names - easy to make a mistake

I think i have the same problem.

1.I change "on" to "off".
2.File, save and i get this:" impossible to create file C:\program\files\postgresSQL\8.3\data\postgresql.c omf, please check the name and access way are ok(translation from french, might not be the exact terms used in english)
3. I click ok
4.save as... options pops up
5.im in postgesql\8.3\data
6.i click save
7.its says :" postgesql.conf already exist, do you want to replace it?
8.I click yes
9. I get #2 message

What am i doing wrong?

i use vista

netsrak
08-18-2010, 04:29 AM
Thats a permission problem under vista.

1. stop your postgresql service
2. open and edit the file and save it in a different folder like the desktop
3. rename the original file
4. move the changed file to the original folder.

jenkulle
09-07-2010, 10:12 PM
would be good to mention that with 8.4 it's already turned off...


also you could add into your text to search for x line with ctrl+f ..a lot easier to look for ''logging_collector'' then scrolling down heheh :rolleyes:

Edmuntus
09-24-2010, 09:15 AM
What about this folder C:\Program Files\PostgreSQL\8.3\data\base. This one is almost 12G . Can i delete this one?

Thanks

How big is this going to get. I changed the postgresql.conf file long time ago and now see the file in the data\base map are getting huge.

Got 6 submaps in the data map

data\1
data\11510
data\11511
data\16438 -> 415MB
data\17624 -> 67,7 Giga Byte
data\pgsql_tmp

How can these be compressed or can they be deleted?

I also got a file in the Holdemmanager\Importing\Logs map called "Trace.bak" which is 4,5 GB and another one called "Trace.txt" of 1 GB.

Patvs
09-24-2010, 11:16 PM
The trace.bak file is a temp file and should disappear if you restart your computer.

Did you do a massive import today?
Do you have SEVERAL databases (old databases you no longer use)?
Are you mostly importing datamined hands, if so just purge all the hands.


read:
http://forums.holdemmanager.com/manager-general/11194-top-10-hem-performance-increase-tips.html

(do the tips to decrease the size of the database)

Edmuntus
09-25-2010, 05:27 AM
When starting up today the trace.bak file is now 1gb, but the trace.txt is suddenly 3,5gb. I just played yesterday. About 4k hands. Thats it.

I just have one database.

I have imported a decent amount of hands. Did a purge a while ago. Ill do a new one.

Still wondering about the huge file sizes.

slideby
11-07-2010, 03:33 PM
Hey guys i have done these steps and the files have done but when turning on HM im getting 'failure to connect to 127.0.0.1

Have i done something wrong or is this a simple issue.

Thanks in advance

Patvs
11-07-2010, 08:50 PM
This is usually a firewall or windows update issue.
First try to reboot.
If no help, try this:

Start > Programs > PostgreSQL > 8.x > Stop Service

Start > Programs > PostgreSQL > 8.x > Start Service

If that doesnt help delete the \postgresql\8.x\data\postmaster.pid file, if you see it. And reboot

Add exceptions to the windows firewall, even if it is off.

If that doesn't help you will have to reinstall PostgreSQL completely

slideby
11-08-2010, 05:45 PM
hi, thanks for this. Ive had to re install but have another issue.

Its now taking me to the database control panel. It only says create new database, can i keep me old files somehow.

Many thanks

Patvs
11-08-2010, 08:08 PM
Did you reinstall SQL to a different port?? (if so, maybe you can see your old database when you connect to the old port)
If it doesn't display your old database, create a new database, and reimport all your hands (run a import from folder on your archive folder)

slideby
11-09-2010, 05:04 PM
Hi thanks, im not sure what port it was but ive imported all the old hhs. whilst it has all the same players, it doesnt seem to show any results, is there anyway around this.

also, will i have to re setup my hud etc??

thanks again

Patvs
11-09-2010, 09:20 PM
You don't have to resetup the HUD.
It doesn't show your results... using which SQL version?
Are you using a non-English version of Windows?

Lunatic973
11-29-2010, 03:20 AM
Is this process still necessary with 8.4??? I'm running the latest version of HEM....Windows 7....In the log folder there was only 1 log from about 5 days ago. Which is the first day I installed HEM on this new computer. I've played everyday since so I don't why it would only have logged on that one day.

Never mind...I just answered my own question. I checked the file, and the logging was turned off already.

stbab4
03-30-2014, 08:43 PM
Ok, so i try do do this thing too. The problem is that when i open the file postgresql.conf, the logs are alredy turned off.
By the way, the path to reach this file for me is: C:/postresSQL/data. CAN'T FIND IT IN PROGRAM FILES OR PROGRAM FILES 86.
So, i am looking in the rong place?

Patvs
03-30-2014, 09:20 PM
Default location is C:/Program Files(x86)/PostgreSQL/8.x/data
If you're using a 64 bit version it will be C:/Program Files/PostgreSQL/9.x/data.


Double check if you don't have (a different version of) PostgreSQL installed to a different folder.
If the only folder is C:/postresSQL/data, manually delete the files from the C:/postresSQL/data/pg_log folder.

bismark
09-04-2016, 07:35 AM
hi, i want to stop logging but i have the 9.3 version, dont match with the 8.4, how i can do it?

fozzy71
09-04-2016, 10:53 AM
hi, i want to stop logging but i have the 9.3 version, dont match with the 8.4, how i can do it?

It should be similar enough that these instructions help you - Hold'Em Manager 2 FAQs - Poker Software :: Large Log Files (http://hm2faq.holdemmanager.com/questions/1121/Large+Log+Files)

If you get stuck on any specific step post details and I can take a look at my 9.3 or 9.5 installations and guide you through it and see if we need to update our FAQ or create another one for 9.x versions.