From 2c00778a3ee6ecf880457d9cf0c3f892b6ac2c81 Mon Sep 17 00:00:00 2001
From: mekya <ahmetmermerkaya@gmail.com>
Date: Mon, 19 Apr 2021 16:09:09 +0300
Subject: [PATCH] Write stderr to log/antmedia-error.log

---
 src/main/server/start.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main/server/start.sh b/src/main/server/start.sh
index b094e8aaa..d02afc675 100644
--- a/src/main/server/start.sh
+++ b/src/main/server/start.sh
@@ -159,6 +159,9 @@ fi
 
 export RED5_CLASSPATH="${RED5_HOME}/ant-media-server-service.jar${P}${RED5_HOME}/conf${P}${CLASSPATH}"
 
-# start Red5
+# create log directory
+mkdir log
+
+# start Ant Media Server
 echo "Starting Ant Media Server"
-exec "$JAVA" -Dred5.root="${RED5_HOME}" $JAVA_OPTS -cp "${RED5_CLASSPATH}" "$RED5_MAINCLASS" $RED5_OPTS
+exec "$JAVA" -Dred5.root="${RED5_HOME}" $JAVA_OPTS -cp "${RED5_CLASSPATH}" "$RED5_MAINCLASS" $RED5_OPTS 2>>${RED5_HOME}/log/antmedia-error.log