-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Both InnoDB and PostgreSQL - as well as many other databases - use a technique called multi-version concurrency control (MVCC) to provide transaction isolation: transactions should not see the work of other, uncommitted transactions. MVCC means that, when a row is updated, the database stores both the old and new versions of the row.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Friday, August 12, 2011

Report Developer's About Error/Warning in Codes from Apache Logs

This is just a scenario i got it in mind, Reporting Warning/Error  to Developer(s), using a PERL script, this you can also be done using SHELL Script.

#!/usr/bin/perl



use Net::SMTP;
my $date=`date +%a" "%b" "%d`;
my $warn="Warning:";
my $line1=`cat /var/log/apachelogs/error_log | grep -i 'php warning' | grep '$date' | awk -F'$warn' '{print \$2}' | sort | uniq -c | sed G > /tmp/get-PHP-errors.txt`;

my $line=`cat /tmp/get-PHP-errors.txt`;

my $ServerName = "mail2.mailer.com";

my $RealNameFrom = "PHP Warnings";

my $MailFrom = "noreply\@tech-suppport.com";

my $RealNameTo = "Web Coders";

my $MailTo = "delhi.manish\@gmail.com";

my $MailSubject = "Apache Error Log On Stagging Server";

$smtp = Net::SMTP->new($ServerName);

die "Couldn't connect to server" unless $smtp;

$smtp->mail( $MailFrom );
$smtp->to( $MailTo );

$smtp->data();

$smtp->datasend("To: $RealNameTo <$MailTo>\n");
$smtp->datasend("From: $RealNameFrom <$MailFrom>\n");
$smtp->datasend("Subject: $MailSubject\n\n");

$smtp->datasend("$line");
$smtp->dataend();

$smtp->quit();

No comments:

Post a Comment