rlarranaga / bafprp

Automatically exported from code.google.com/p/bafprp
0 stars 0 forks source link

log and errors in mysql #46

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I run the script from the command line (will be a cron soon)
/usr/bin/bafprp -rmysql -prdsn:BAF -prtable:records -petable:errors 
-pltable:logs BAF*

My LOGS and ERRORS schemas I got from the mysql wiki here

It outputs:
Set record output to file
Set error output to file
Set log output to file
Set record property filename to /var/log/bafprp/record.log
Set error property filename to /var/log/bafprp/error.log
Set log property filename to /var/log/bafprp/log.log
Set record output to mysql
Set record property dsn to BAF
Set record property table to records
Set error property table to errors
Set log property table to logs

I am running BAFPRP v1.3.1 (with a small change I got from Charles) on 
Debian7x64

The /var/log/bafprp/* log files, I had to create as root, and chmod 777 (maybe 
777 is too much, but it works) in order for another user than root to write... 
the error.log is empty (as it should, since there weren't any errors)
the log.log has the INFO lines:
- 2015-06-08 11:18:29 INFO: Running Program
- 2015-06-08 11:18:29 INFO: Processing BAF started
- 2015-06-08 11:18:46 INFO: Parsed x records
- 2015-06-08 11:18:46 INFO: Removed x duplicates
- 2015-06-08 11:18:46 INFO: Processing BAF ended
- 2015-06-08 11:18:46 INFO: Cleanup started
- 2015-06-08 11:18:46 INFO: Cleanup ended
- 2015-06-08 11:18:46 INFO: Processed a total of x records
- 2015-06-08 11:18:46 INFO: Program Terminated
the record.log is empty

WHen I look in the tables for errors and logs, they are empty as well.

How can i log to the database?   I have tried adding -rltable:logs and 
-retable:errors to the command line, and that didn't help either.

the database user has full access to the errors/logs/records tables in the 
database... so it isn't a write issue...

Original issue reported on code.google.com by thestapl...@gmail.com on 8 Jun 2015 at 3:25

GoogleCodeExporter commented 8 years ago
You probably need to set the output format for errors and logs to mysql.  The 
option -rmysql only sets record output to mysql, add -emysql and -lmysql

Original comment by charless...@gmail.com on 8 Jun 2015 at 6:58

GoogleCodeExporter commented 8 years ago
Thanks, I never thought to add that.

:)

Original comment by thestapl...@gmail.com on 8 Jun 2015 at 7:30