From 9c5a1d0b3e6c3d5b4f5ac38ef831bad21f98a467 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Sat, 15 Nov 2008 13:36:34 +0000
Subject: [PATCH] Adding docmentation on the statistics module

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1015 44740490-163a-0410-bde0-09ae8108e29a
---
 docs/source/simplesamlphp-mod_statistics.xml | 126 +++++++++++++++++++
 1 file changed, 126 insertions(+)
 create mode 100644 docs/source/simplesamlphp-mod_statistics.xml

diff --git a/docs/source/simplesamlphp-mod_statistics.xml b/docs/source/simplesamlphp-mod_statistics.xml
new file mode 100644
index 000000000..3514b8664
--- /dev/null
+++ b/docs/source/simplesamlphp-mod_statistics.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<article>
+  <title>The simpleSAMLphp statistics module</title>
+
+  <articleinfo>
+    <date>2007-10-15</date>
+
+    <pubdate>Sat Nov 15 14:34:28 2008</pubdate>
+
+    <author>
+      <firstname>Andreas Ă…kre</firstname>
+
+      <surname>Solberg</surname>
+
+      <email>andreas.solberg@uninett.no</email>
+    </author>
+  </articleinfo>
+
+  <section>
+    <title>Configure your logs</title>
+
+    <para>Reccomended to use syslog for logging. Then a separate loglevel is
+    dedicated to statistics. You need to get all statistics log entries in one
+    log file. Here is how I do it in syslog.conf:</para>
+
+    <programlisting># SimpleSAMLphp logging
+local5.*						/var/log/simplesamlphp.log
+# Notice level is reserved for statistics only...
+local5.=notice					/var/log/simplesamlphp.stat</programlisting>
+
+    <para>Then make sure you have configured this correctly such that you have
+    one log file like this:</para>
+
+    <screen># ls -la /var/log/simplesamlphp.stat
+-rw-r--r-- 1 root root 76740 Nov 15 13:37 /var/log/simplesamlphp.stat</screen>
+
+    <para>With content that looks like this:</para>
+
+    <screen># tail /var/log/simplesamlphp.stat
+Nov 15 12:01:49 www1 simplesamlphp-foodle[31960]: 5 STAT [77013b4b6e] saml20-sp-SSO urn:mace:feide.no:services:no.feide.foodle sam.feide.no andreas@uninett.no
+Nov 15 13:01:14 www1 simplesamlphp-openwiki[2247]: 5 STAT [50292b9d04] saml20-sp-SSO urn:mace:feide.no:services:no.feide.openwikicore sam.feide.no NA
+Nov 15 13:16:39 www1 simplesamlphp-openwiki[2125]: 5 STAT [3493d5d87f] saml20-sp-SSO urn:mace:feide.no:services:no.feide.openwikicore sam.feide.no NA
+Nov 15 13:37:27 www1 simplesamlphp-foodle[3146]: 5 STAT [77013b4b6e] AUTH-login-admin OK</screen>
+
+    <para>Here you can see that I collect statistics in one file for several
+    installations. You could easily separate each instance of simpleSAMLphp
+    into separate files (your preference).</para>
+  </section>
+
+  <section>
+    <title>Configure the statistics module</title>
+
+    <para>First enable the statistics module, as you enable any other
+    module:</para>
+
+    <screen>cd modules/statistics
+touch enable
+</screen>
+
+    <para>Then take the configuration template:</para>
+
+    <screen>cp modules/statistics/config-templats/*.php config/</screen>
+
+    <para>Configure the path of the log file:</para>
+
+    <programlisting>	'inputfile' =&gt; '/tmp/stat',</programlisting>
+
+    <para>and the syntax of the log file. You need to configure where the date
+    starts (usually 0), and how long the date is (usually 15), and where the
+    first columns starts (such that STAT is in column 3):</para>
+
+    <programlisting>	'datestart' =&gt; 1,
+	'datelength' =&gt; 15,
+	'offsetspan' =&gt; 21,</programlisting>
+
+    <para>Make sure the stat dir is writable. SimpleSAMLphp will write data
+    here:</para>
+
+    <programlisting>	'statdir' =&gt; '/tmp/stats/',</programlisting>
+
+    <section>
+      <title>Setup cron</title>
+
+      <para>You also should setup the cron module:</para>
+
+      <screen>cd modules/cron
+touch enable
+</screen>
+    </section>
+
+    <section>
+      <title>Alternatively to use the cron module</title>
+
+      <para>Alternatively to use the cron module you can run the
+      script<filename> statistics/bin/loganalyzer.php</filename>.</para>
+    </section>
+  </section>
+
+  <section>
+    <title>Presentation of the statistics</title>
+
+    <para>At the installation page there will be a link "show statitics", go
+    there and if simpleSAMLphp finds the statistics files in the
+    <filename>statdir</filename> generated from cron or the script you will
+    see statistics. Enjoy.</para>
+  </section>
+
+  <section>
+    <title>Support</title>
+
+    <para>If you need help to make this work, or want to discuss simpleSAMLphp
+    with other users of the software, you are fortunate: Around simpleSAMLphp
+    there is a great Open source community, and you are welcome to join! The
+    forums are open for you to ask questions, contribute answers other further
+    questions, request improvements or contribute with code or plugins of your
+    own.</para>
+
+    <para>Visit the project page of simpleSAMLphp at: <ulink
+    url="http://code.google.com/p/simplesamlphp/">http://code.google.com/p/simplesamlphp/</ulink></para>
+
+    <para>Please join the mailinglist: <ulink
+    url="???">https://postlister.uninett.no/sympa/subscribe/simplesaml</ulink></para>
+  </section>
+</article>
\ No newline at end of file
-- 
GitLab