Reading Serial Data sent from PC to Arduino with help of another Arduino

I am trying to sniff the Serial Communication between the PC and Arduino MEGA 2560. For trying to check what my PC is sending to my Arduino. I am using another Arduino MEGA 2560 to read this data since my serial monitor is busy.
To this I have connected RX pin of my arduino to RX Pin of my second arduino and both have common ground. In this way i thought i can use serial monitor of my second arduino to see the data what my pc is sending to Arduino.
But when i upload the program to Arduino, I am getting the following error

avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer

I dont have any problems when i use only one Arduino.
One Arduino uses COM Port 4 and other uses COM Port 5. I am not sure what is going wrong. I googled this problem and found few things but none of them were quiet working for me.
The main issue which i am not sure is if i can use Arduino IDE instance twice(one for each arduino with different com port) and check what my pc is sending to first arduino with the help of second arduino.
Can anyone suggest some other alternative on how to see serial data when serial monitor is busy or when we cant use serial monitor?

what process is sending data to the Arduino Mega in the first place? can't you check there?

Your connection is
PC <=== (usb) ===> MEGA Serial (0/1)
nothing prevents the MEGA to capture what's coming and echo-ing it back to the PC.

You can use alternate Serial Monitors (PuTTY for example) if you don't want to run 2 instances of the IDE

sandeepmaddula:
But when i upload the program to Arduino, I am getting the following error

I suspect the problem arises because you have something connected to the pins for Serial (pins 0 and 1) which is used for uploading programs. Either disconnect whatever it is before trying to upload a program or, better, connect the thing to Serial1 (pins 19 and 18).

...R