Skip to content

Instantly share code, notes, and snippets.

@kubaceg
Last active August 29, 2015 14:21
Show Gist options
  • Save kubaceg/4277ab6f7a2dcaae66bb to your computer and use it in GitHub Desktop.
Save kubaceg/4277ab6f7a2dcaae66bb to your computer and use it in GitHub Desktop.
Shell script for creating tmux two panel window with Magento system and exception log

Instalation

Download script

  wget https://gist.githubusercontent.com/kubaceg/4277ab6f7a2dcaae66bb/raw/5f7e178ca8d76858258038aa5cb6903a36f71ad6/magento-log

Make it executable

  chmod +x mageno-log

If you want to use the command system wide you can copy it to /usr/local/bin

  sudo cp ./n98-magerun.phar /usr/local/bin/

Usage

Just execute magento-log in your Magento installation main directory (place where Magento index.php is)

Needed packages

  • tmux
#!/bin/sh
if [ -e app/Mage.php ]
then
set -x
tmux new-session -d -s magento-log
tmux new-window -t magento-log:1 'tail -f var/log/system.log'
tmux select-window -t magento-log:1
tmux split-window -v 'tail -f var/log/exception.log'
tmux attach -t magento-log
else
echo "No Magento found!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment