Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Log submissions to a file

Author: Eileen Wilde Reference Number: AA-00154 Views: 8464 Last Updated: 02/15/2010 09:17 AM 0 Rating/ Voters

The log template is designed to record all form submissions and to present them in a suitable human-readable format to you.

Log consists of 2 files. First one is the log template. Second is the file where records will be stored. In log template you set name of your actual log file (where records will be stored) and format of record that will be added to log file.

Log templates must have the filename of the log to write to on the first line of the template. Everything after the first line will be appended (tacked onto the bottom of the file specified).

Example in config.php (path should be a relative path from FPP folder to log template file):

log_file = ../path/log_template.txt

Example of the content for a logging template (DB or CSV file) (first line is the name of file where records will be stored, this name can be any. In this case log file will be located in same folder as log template file. Here you can set path for log file, it will be relative to log template folder):

simple.csv

"{#eMail#}";"{#Name#}"

Result (the simple.csv file could contain these lines):

"one@email.com";"name1"
"two@email.com";"name2"

You can also use multiline syntax for your log:

simple.txt

Email: {#eMail#}
Name: {#Name#}
-----

Result for multiline log (the simple.txt file could contain these lines):

Email: one@email.com
Name: name1
-----
Email: two@email.com
Name: name2
-----

Note:
The path to the log file in the log template is relative to the log  template file. For example: if  the log template and the log file are in the same folder, the path to the log file is just the name of log file. If the log template is in the folder 'public_html/' and the log file will be in the folder 'public_html/log/', then the path should be 'log/simple.log'
Note:
To show double quotes in CSV file correctly use csv_shielding modifier.