Hi,

Strange. Are you sure, you test with the latest git. Can you check, that you have the latest check in "b08f4c436234f54086e71739501e0b6ffa9ac668" with the comment "fix setting access log file using the method tnt::Tntnet::setAccessLog". And verify, that you really test against it.

I tested it with the bookshop demo using the Configuration class. I attach the diff against bookshop HEAD I used.

Tommi

Am 11.04.2015 um 17:40 schrieb Jean-Marc Choulet:
OK for daemonize().

I don't have TntConfig variable. As your bookshop example, I created the Configuration class and I use it to call setAccessLog method. I tried with the latest git version of tntnet without success.

Jean-Michel



Le 11/04/2015 16:02, Tommi Mäkitalo a écrit :
There is no direct support of starting your own app as a daemon. But you may want to use the function:

    cxxtools::posix::daemonize(const std::string& pidfile =
    std::string());



After that the process runs in the background. Note that the pid of the current process will change since this function calls fork and exit for the current process and continues in the forked process.

Tommi

Am 11.04.2015 um 15:47 schrieb Jean-Marc Choulet:
Le 11/04/2015 15:39, Tommi Mäkitalo a écrit :
Either update to latest git version, where I just checked in a fix or use:
Latest git version of tntnet only ?

And to start my app as daemon ? I don't find any method to set this
parameter in my main.cpp file.

Jean-Marc

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF


_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF


_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

diff --git a/src/bookshop.conf b/src/bookshop.conf
index 1a7ad98..a2e0cea 100644
--- a/src/bookshop.conf
+++ b/src/bookshop.conf
@@ -2,6 +2,7 @@ listen.port 8000
 sessiontimeout 3600
 
 dburl       postgresql:dbname=bookshop
+accessLog   access.log
 
 # configure logger
 # log level may be FATAL, ERROR, WARN, INFO, DEBUG or TRACE
diff --git a/src/configuration.cpp b/src/configuration.cpp
index 5144197..65c57c9 100644
--- a/src/configuration.cpp
+++ b/src/configuration.cpp
@@ -38,6 +38,7 @@ void operator>>= (const cxxtools::SerializationInfo& si, Configuration& config)
   si.getMember("listen.ip", config._listenIp);
   si.getMember("listen.port") >>= config._listenPort;
   si.getMember("sessiontimeout") >>= config._sessionTimeout;
+  si.getMember("accessLog", config._accessLog);
   si.getMember("dburl") >>= config._dburl;
   si >>= config._loggingConfiguration;
 }
diff --git a/src/configuration.h b/src/configuration.h
index 177775d..19a8b95 100644
--- a/src/configuration.h
+++ b/src/configuration.h
@@ -49,6 +49,9 @@ class Configuration
     const std::string& dburl() const
     { return _dburl; }
 
+    const std::string& accessLog() const
+    { return _accessLog; }
+
     const cxxtools::LogConfiguration& loggingConfiguration() const
     { return _loggingConfiguration; }
 
@@ -61,6 +64,7 @@ class Configuration
     unsigned short _listenPort;
     unsigned       _sessionTimeout;
     std::string    _dburl;
+    std::string    _accessLog;
     cxxtools::LogConfiguration _loggingConfiguration;
 };
 
diff --git a/src/main.cpp b/src/main.cpp
index 89b5ab5..23820ba 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -42,6 +42,10 @@ int main(int argc, char* argv[])
     tnt::Configurator configurator(app);
     configurator.setSessionTimeout(configuration.sessionTimeout());
 
+    // both variants work fine for me:
+    app.setAccessLog(configuration.accessLog());
+    //configurator.setAccessLog(configuration.accessLog());
+
     // configure static stuff - lookup files in static resources first
     app.mapUrl("^/(.*)", "resources")
        .setPathInfo("resources/$1");
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to