titotoms 0 Newbie Poster 18 Years Ago Hi, What is a log file?What is its purpose?How do I open, read and write to log files? Thanks, Toms shell-scripting unix 0 0 Share pty 882 Posting Pro 18 Years Ago A log file is a record of what has happened. On linux/unix they tend to be in /var/log. As a developer I use them when stuff goes wrong and I want to find out why. IT use them to keep tabs on things, monitor network use etc. Web masters use them to spot trends and stuff (often using something to interpret their log files like webalizer). You write to a log file like any other text file. To read from one just type cat filename.log or tail filename.log . A useful way of printing the end of a log file and update it when it changes is to use tail -f filename.log . 0 0 Share Lalchand Saini 0 Newbie Poster 14 Years Ago LOG_FILE=/home/iocca_d/app/logs/logfilename.LOG exec 1>> ${LOG_FILE} 0 0 Share Share Facebook Twitter LinkedIn Reply to this topic Be a part of the DaniWeb community We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge. Sign Up — It's Free!
pty 882 Posting Pro 18 Years Ago A log file is a record of what has happened. On linux/unix they tend to be in /var/log. As a developer I use them when stuff goes wrong and I want to find out why. IT use them to keep tabs on things, monitor network use etc. Web masters use them to spot trends and stuff (often using something to interpret their log files like webalizer). You write to a log file like any other text file. To read from one just type cat filename.log or tail filename.log . A useful way of printing the end of a log file and update it when it changes is to use tail -f filename.log . 0 0 Share
Lalchand Saini 0 Newbie Poster 14 Years Ago LOG_FILE=/home/iocca_d/app/logs/logfilename.LOG exec 1>> ${LOG_FILE} 0 0 Share