summaryrefslogtreecommitdiff
path: root/tutorial/erl
diff options
context:
space:
mode:
authorChristopher Piro <cpiro@apache.org>2008-01-15 12:04:12 +0000
committerChristopher Piro <cpiro@apache.org>2008-01-15 12:04:12 +0000
commit5165f3e65ed5a072099f561d28b3b3994ab8aa95 (patch)
treefaf784cb32937ad0250419043720691ce29a8b0f /tutorial/erl
parent8ca66b8805921f2ec60f088177f0e9596f08dc57 (diff)
downloadthrift-5165f3e65ed5a072099f561d28b3b3994ab8aa95.tar.gz
[thrift] add a configuration file to the Erlang server tutorial
Summary: Logger configuration (and all Thrift config in Erlang) now uses application:get_env/2 via thrift:config/2. Defaults can be provided on the erl command line with ``-config <filename>''. It may also be helpful to cascade config files; {key, value} pairs provided in subsequent files will override previous ones -- e.g. in our applications we use ``-config base.config -config cpiro.config''. server.config was added as an example and server.sh was updated to invoke erl with ``-config server.config''. Reviewed By: eletuchy Test Plan: the tutorial server now outputs a reasonable set of messages Revert Plan: ok git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665426 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tutorial/erl')
-rw-r--r--tutorial/erl/server.config28
-rwxr-xr-xtutorial/erl/server.sh2
2 files changed, 29 insertions, 1 deletions
diff --git a/tutorial/erl/server.config b/tutorial/erl/server.config
new file mode 100644
index 000000000..14ab752de
--- /dev/null
+++ b/tutorial/erl/server.config
@@ -0,0 +1,28 @@
+%% -*- erlang -*-
+
+[ %% begin config %%
+
+{thrift, [
+ {term_width, 110},
+ {force_one_line, false},
+
+ %% a list of ?INFO format strings that WILL NOT be output
+ {omit_fmt, [
+%"application ~p reconfigured: ~p keys updated" ,% ?INFO thrift.erl
+"thrift connection accepted from ~s" ,% ?INFO tErlAcceptor.erl
+"thrift connection closed from ~s" ,% ?INFO tErlAcceptor.erl
+"thrift connection timed out from ~s" ,% ?INFO tErlAcceptor.erl
+"thrift request: ~p" ,% ?INFO tErlAcceptor.erl
+%"thrift server listening on port ~p" ,% ?INFO tErlServer.erl
+"thrift ~p:new(~s) = ~s" ,% ?INFO thrift_oop_server.erl
+"oop:call called: Obj=~p Func=~p ArgsProper=~p",
+"tSocket: read ~p",
+
+"end of log filters"]},
+
+ {show_pid, true},
+ {gen_server_messages, true},
+ {lookup, true},
+{'end of config', thrift_logger}]}
+
+]. %% end config %%
diff --git a/tutorial/erl/server.sh b/tutorial/erl/server.sh
index a76352693..7ed611af3 100755
--- a/tutorial/erl/server.sh
+++ b/tutorial/erl/server.sh
@@ -15,4 +15,4 @@ fi
erlc -I ${ERL_THRIFT}/include -I ../gen-erl -o ../gen-erl ../gen-erl/*.erl &&
erlc -I ${ERL_THRIFT}/include -I ../gen-erl *.erl &&
- erl +K true -pa ${ERL_THRIFT}/ebin -pa ../gen-erl
+ erl +K true -pa ${ERL_THRIFT}/ebin -pa ../gen-erl -config server.config