And this is the file output
Code: Select all
2017-07-25, 06:07:03.592, 'Test Logger, Thread-96, GENERIC, Map#Admin, 17
2017-07-25, 06:07:03.599, 'Test Logger, Thread-96, GENERIC, Map#Admin, 17
2017-07-25, 06:07:03.604, 'Test Logger, Thread-96, GENERIC, Map#Admin, 20 Executing process ShowPerson
2017-07-25, 06:07:03.610, 'Test Logger, Thread-96, ACTION_EXECUTION, Map#Admin , 34 Value of Person could not be resolved
2017-07-25, 06:07:03.612, 'Test Logger, Thread-96, RULE_EVALUATION, Map#Admin , 29 Started evaluation of rules
2017-07-25, 06:07:03.617, 'Test Logger, Thread-96, RULE_EVALUATION, Map#Admin , 22 Evaluating rule 'Show' CREATE Person EDIT Person USING Main
2017-07-25, 06:07:03.619, 'Test Logger, Thread-96, RULE_EVALUATION, Map#Admin , 2 Adding action CREATE Person to the agenda
2017-07-25, 06:07:03.620, 'Test Logger, Thread-96, RULE_EVALUATION, Map#Admin , 2 Adding action EDIT Person USING Main to the agenda
2017-07-25, 06:07:03.621, 'Test Logger, Thread-96, RULE_EVALUATION, Map#Admin , 16 Finished rule evaluation
2017-07-25, 06:07:03.621, 'Test Logger, Thread-96, RULE_EVALUATION, Map#Admin , 16 Finished evaluation of rules
2017-07-25, 06:07:03.622, 'Test Logger, Thread-96, ACTION_EXECUTION, Map#Admin , 15 Executing action CREATE Person
2017-07-25, 06:07:03.672, 'Test Logger, Thread-96, ACTION_EXECUTION, Map#Admin , 16 Finished executing action CREATE Person
2017-07-25, 06:07:03.674, 'Test Logger, Thread-96, ACTION_EXECUTION, Map#Admin , 15 Executing action EDIT Person USING Main
2017-07-25, 06:07:03.675, 'Test Logger, Thread-96, ACTION_EXECUTION, Map#Admin , 16 Finished executing action EDIT Person USING Main
2017-07-25, 06:07:03.682, 'Test Logger, Thread-96, GENERIC, Map#Admin, 21 Process ShowPerson is suspended. Its id is 3
2017-07-25, 06:07:03.686, 'Test Logger, Thread-96, GENERIC, Map#Admin, 17
2017-07-25, 06:07:03.691, 'Test Logger, Thread-96, GENERIC, Map#Admin, 17
The requirements are:
- Database - I called mine logging
- 3 tables
- log_general
- log_business
- log_test
Update the parameters with
- Path to your database
- User name
- Password
- update the logdir to wherever you want your logger files to go. Be aware that the files are all being placed in related subdirectories of this logdir, if you don't want this to happen you will need to edit everywhere that files are created
I have left everything to continue to log to files, though I have changed these files to be RollingDaily. This means at your server's midnight it will roll over to a new file and rename the old one.
I have belt and braced the date to include, date, time and a database timestamp. You could probably reduce this but I figured that it is easier for filtering to have all three.
The why: by putting my logs into MySQL I can monitor rule execution on a remote server (log viewer isn't available as I don't have x-server running) in a semi real time, whereas with just a file I have to use an FTP retrieve file or open in an ssh session and then view the file and obviously the file I am viewing will not update
-------------------------------------------------------------------------
Standard disclaimer:
This probably won't ruin you financially, but if it does, you didn't get it from me.
If your pets suddenly don't love you, your milk goes off, or your hot water tank busts, I disclaim all responsibility.