[Seaside] Re: [Seaside-commits] aubergines/seaside Seaside2.mc,1.14,1.15

Stephen Pair stephen at pairhome.net
Sat May 17 01:15:52 CEST 2003


>
> Presumably for logging we'd want to add some more info the the 
> WARequest object and then you could write a Filter to be applied to 
> every seaside request.  Though... doesn't Comanche do logging of some 
> kind?  What do you want to log that you can't do at that level?
>
> Julian 



Comanche 6.1 supports the Common Log Format (CLF) out of the box and can 
easily be extended to support additional formats.  See the class 
comments for ModLog for examples.  Also, with the StarBrowser user 
interface, you can easily pop open transcripts to follow the logs as 
they get written.  ModLog writes request/response pairs to an instance 
of a KomLogger using a stream interface.  KomLogger then transforms the 
request/response pairs into a textual log entry and dumps that on any 
number of character streams.  You could subclass KomLogger to substitute 
your own log format (or even store the request/response pairs in an 
OODB!).  You can place multiple ModLogs at different places in your 
module assembly to log to different locations with different log formats 
if you like.  For example:

---------------------
    | ma seaside |
    seaside := WAKom new.
    ma := ModuleAssembly core.
    ma alias: '/seaside' to:
        [ma logTo: (KomLogger on: Transcript).
        ma addPlug: [ :request | seaside process: request]].
    ma logTo: (KomLogger on: (FileStream fileNamed: 'files.log')).
    ma documentRoot: FileDirectory default fullName.
    ma directoryIndex: 'index.html index.htm'.
    ma serveFiles.

    (HttpService startOn: 8080 named: 'Example') module: ma rootModule.
---------------------

This example will log requests that hit seaside to the Transcript while 
all other requests will go to the file named 'files.log'.

- Stephen




More information about the Seaside mailing list