Index: /code/branches/testing/src/libraries/core/Core.cc
===================================================================
--- /code/branches/testing/src/libraries/core/Core.cc	(revision 9537)
+++ /code/branches/testing/src/libraries/core/Core.cc	(revision 9538)
@@ -181,5 +181,5 @@
 
         // Set the correct log path and rewrite the log file with the correct log levels
-        OutputManager::getInstance().getLogWriter().setLogPath(PathConfig::getLogPathString());
+        OutputManager::getInstance().getLogWriter().setLogDirectory(PathConfig::getLogPathString());
 
 #if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN)
Index: /code/branches/testing/src/libraries/util/output/LogWriter.cc
===================================================================
--- /code/branches/testing/src/libraries/util/output/LogWriter.cc	(revision 9537)
+++ /code/branches/testing/src/libraries/util/output/LogWriter.cc	(revision 9538)
@@ -58,9 +58,11 @@
         // get the path for a temporary file, depending on the system
 #ifdef ORXONOX_PLATFORM_WINDOWS
-        this->path_ = getenv("TEMP");
+        this->directory_ = getenv("TEMP");
 #else
-        this->path_ = "/tmp";
+        this->directory_ = "/tmp";
 #endif
-        this->bDefaultPath_ = true;
+
+        // send a message to the user so that he can find the file in the case of a crash.
+        OutputManager::getInstance().pushMessage(level::user_info, context::undefined(), "Opening log file " + this->getPath());
 
         this->openFile();
@@ -80,13 +82,6 @@
     void LogWriter::openFile()
     {
-        // get the full file-name
-        std::string name = this->path_ + '/' + this->filename_;
-
-        // if we open the log file in the default directory, send a message to the user so that he can find the file in the case of a crash.
-        if (this->bDefaultPath_)
-            OutputManager::getInstance().pushMessage(level::user_info, context::undefined(), "Opening log file " + name);
-
         // open the file
-        this->file_.open(name.c_str(), std::fstream::out);
+        this->file_.open(this->getPath().c_str(), std::fstream::out);
 
         // check if it worked and print some output
@@ -112,13 +107,12 @@
         @brief Changes the path of the log-file. Re-writes the log-file by using MemoryWriter.
     */
-    void LogWriter::setLogPath(const std::string& path)
+    void LogWriter::setLogDirectory(const std::string& directory)
     {
         // notify about the change of the log-file (because the old file will no longer be updated)
-        OutputManager::getInstance().pushMessage(level::internal_info, context::undefined(), "Migrating log file from " + this->path_ + "\nto " + path);
+        OutputManager::getInstance().pushMessage(level::internal_info, context::undefined(), "Migrating log file from " + this->directory_ + "\nto " + directory);
 
         // close the old file, update the path and open the new file
         this->closeFile();
-        this->path_ = path;
-        this->bDefaultPath_ = false;
+        this->directory_ = directory;
         this->openFile();
 
Index: /code/branches/testing/src/libraries/util/output/LogWriter.h
===================================================================
--- /code/branches/testing/src/libraries/util/output/LogWriter.h	(revision 9537)
+++ /code/branches/testing/src/libraries/util/output/LogWriter.h	(revision 9538)
@@ -61,5 +61,12 @@
             virtual ~LogWriter();
 
-            void setLogPath(const std::string& path);
+            void setLogDirectory(const std::string& directory);
+
+            /** @brief Returns the path to the logfile. */
+            inline std::string getPath() const
+                { return this->directory_ + '/' + this->filename_; }
+            /** @brief Returns the open file stream. */
+            inline const std::ofstream& getFile() const
+                { return this->file_; }
 
         protected:
@@ -70,8 +77,6 @@
             void closeFile();
 
-            std::string filename_;  ///< The name of the log-file (without directories)
-            std::string path_;      ///< The path of the log-file (without file-name)
-            bool bDefaultPath_;     ///< If true, the log-file resides at the default path (which is usually a temporary directory)
-
+            std::string filename_;  ///< The name of the log-file (without directory)
+            std::string directory_; ///< The directory where the log-file resided (without file-name)
             std::ofstream file_;    ///< The output file stream.
     };
Index: /code/branches/testing/test/util/output/ConsoleWriterTest.cc
===================================================================
--- /code/branches/testing/test/util/output/ConsoleWriterTest.cc	(revision 9537)
+++ /code/branches/testing/test/util/output/ConsoleWriterTest.cc	(revision 9538)
@@ -3,4 +3,5 @@
 #include "util/output/ConsoleWriter.h"
 #include "util/output/OutputManager.h"
+#include "util/SharedPtr.h"
 
 namespace orxonox
@@ -8,4 +9,7 @@
     TEST(ConsoleWriterTest, Disable)
     {
+        // reset output manager
+        OutputManager::Testing::getInstancePointer() = new OutputManager();
+
         std::ostream stream(NULL);
         EXPECT_EQ(0U, OutputManager::getInstance().getListeners().size());
@@ -18,4 +22,7 @@
     TEST(ConsoleWriterTest, Enable)
     {
+        // reset output manager
+        OutputManager::Testing::getInstancePointer() = new OutputManager();
+
         std::ostream stream(NULL);
         ConsoleWriter writer(stream);
Index: /code/branches/testing/test/util/output/LogWriterTest.cc
===================================================================
--- /code/branches/testing/test/util/output/LogWriterTest.cc	(revision 9537)
+++ /code/branches/testing/test/util/output/LogWriterTest.cc	(revision 9538)
@@ -1,6 +1,132 @@
 #include <gtest/gtest.h>
 #include "util/Output.h"
+#include "util/output/LogWriter.h"
 
 namespace orxonox
 {
+    // test constructor opens file
+    TEST(LogWriterTest, ConstructorOpensFile)
+    {
+        LogWriter logWriter;
+        EXPECT_TRUE(logWriter.getFile().is_open());
+    }
+
+    // setLogDirectory changes file, opens correct file
+    bool fileExists(const std::string& path)
+    {
+        std::ifstream stream(path.c_str(), std::fstream::in);
+        bool exists = stream.is_open();
+        stream.close();
+        return exists;
+    }
+
+    bool fileSuccessfullyDeleted(const std::string& path)
+    {
+        return std::remove(path.c_str()) == 0;
+    }
+
+    TEST(LogWriterTest, SetLogDirectoryOpensNewFile)
+    {
+        std::string path = "./orxonox.log";
+
+        // cleanup before test
+        fileSuccessfullyDeleted(path);
+
+        {
+            LogWriter logWriter;
+            EXPECT_FALSE(fileExists(path));
+            logWriter.setLogDirectory(".");
+            EXPECT_TRUE(fileExists(path));
+        }
+
+        // cleanup after test
+        EXPECT_TRUE(fileSuccessfullyDeleted(path));
+    }
+
+    // prints output to logfile
+    TEST(LogWriterTest, PrintsOutputToLogfile)
+    {
+        std::string path;
+
+        {
+            // write lines to log file
+            std::vector<std::string> lines;
+            lines.push_back("mytestoutput");
+
+            LogWriter logWriter;
+            logWriter.setLogDirectory(".");
+            logWriter.unfilteredOutput(level::debug_output, context::undefined(), lines);
+
+            path = logWriter.getPath();
+        }
+
+        {
+            std::ifstream file(path.c_str(), std::fstream::in);
+            ASSERT_TRUE(file.is_open());
+            ASSERT_TRUE(file.good());
+            ASSERT_FALSE(file.eof());
+
+            while (!file.eof())
+            {
+                std::string line;
+                std::getline(file, line);
+
+                // see if we find the output and return
+                if (line.find("mytestoutput") != std::string::npos)
+                    return;
+            }
+
+            // output not found - failure!
+            FAIL();
+        }
+    }
+
+    // prints time to logfile
+    TEST(LogWriterTest, PrintsTimestampToLogfile)
+    {
+        std::string path;
+
+        {
+            // write lines to log file
+            std::vector<std::string> lines;
+            lines.push_back("myothertestoutput");
+
+            LogWriter logWriter;
+            logWriter.setLogDirectory(".");
+            logWriter.unfilteredOutput(level::debug_output, context::undefined(), lines);
+
+            path = logWriter.getPath();
+        }
+
+        {
+            std::ifstream file(path.c_str(), std::fstream::in);
+            ASSERT_TRUE(file.is_open());
+            ASSERT_TRUE(file.good());
+            ASSERT_FALSE(file.eof());
+
+            while (!file.eof())
+            {
+                std::string line;
+                std::getline(file, line);
+
+                // see if we find the output and return
+                if (line.find("myothertestoutput") != std::string::npos)
+                {
+                    EXPECT_TRUE(std::isdigit(line[0]));
+                    EXPECT_TRUE(std::isdigit(line[1]));
+                    EXPECT_EQ(':', line[2]);
+                    EXPECT_TRUE(std::isdigit(line[3]));
+                    EXPECT_TRUE(std::isdigit(line[4]));
+                    EXPECT_EQ(':', line[5]);
+                    EXPECT_TRUE(std::isdigit(line[6]));
+                    EXPECT_TRUE(std::isdigit(line[7]));
+                    EXPECT_EQ(' ', line[8]);
+                    return;
+                }
+            }
+
+            // output not found - failure!
+            FAIL();
+        }
+    }
 }
