Created
June 28, 2013 19:55
-
-
Save capflam/5887571 to your computer and use it in GitHub Desktop.
Yaws :: patch to create log directory if it doesn't exist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/yaws_config.erl b/src/yaws_config.erl | |
index ed013c3..3b624dd 100644 | |
--- a/src/yaws_config.erl | |
+++ b/src/yaws_config.erl | |
@@ -739,7 +739,15 @@ fload(FD, globals, GC, C, Cs, Lno, Chars) -> | |
["logdir", '=', Logdir] -> | |
- Dir = filename:absname(Logdir), | |
+ Dir = case Logdir of | |
+ "+" ++ D -> | |
+ D1 = filename:absname(D), | |
+ %% try to make the log directory if it doesn't exist | |
+ yaws:mkdir(D1), | |
+ D1; | |
+ _ -> | |
+ filename:absname(Logdir) | |
+ end, | |
case is_dir(Dir) of | |
true -> | |
put(logdir, Dir), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment