473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Custom 404 and logging

I'm developing an application that uses a custom 404 page to deliver all of
my site's content. However, doing things this way renders IIS's regular log
files pretty much useless.

Are there any established "best practices" for creating your own logging
system? I know that others use this technique and I'm hoping someone has
some ideas they can pass along.

For example, do you log every single page request or do you just log totals
per day, week, or month? How do you deal with the increasing volumes of
data? Do you collect referrer data, etc.?

Thanks,

Paul
Jul 19 '05 #1
4 1919
> Are there any established "best practices" for creating your own logging
system?
"logging system" is far too broadly defined here. What information are you
trying to capture?
For example, do you log every single page request or do you just log totals per day, week, or month?
You're going to get as many answers as respondants. Some people find raw
stats more valuable (because you can pinpoint a specific request and all the
information about that single event, and you can also apply aggregates to
get sums by date range(s)), others conserve disk space (and processing, to
some degree) by just storing aggregates.
How do you deal with the increasing volumes of
data?
Sound database design.
Do you collect referrer data, etc.?


Again, this really depends. I don't think a survey is going to tell you
what information you're interested in... maybe you can tell us what your
requirements are.
Jul 19 '05 #2
Thanks Aaron. I guess I was looking for help in determining what
information I wanted/needed vs. the requirements for storing/processing it.

It's fairly easy to store in a database much of the same information that is
stored in IIS log files (which is what I would like as a minimum). However,
I also know that log files can get huge so I was wondering what strategies
others have used to either reduce the amount of information collected or to
archive the raw data offline, etc. So in this case I would welcome a
variety of opinions as opposed to getting one "right" answer.

When I asked about how to deal with increasing volumes of data, you answered
"sound database design". Do you have any examples? Or even examples of
what NOT to do? For example, is storing raw log data in a single table a
bad idea? My thought was to aggregate/offload the data from that table
perhaps once a month, but of course the frequency would depend on traffic.
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:Oz****************@TK2MSFTNGP12.phx.gbl...
Are there any established "best practices" for creating your own logging
system?
"logging system" is far too broadly defined here. What information are

you trying to capture?
For example, do you log every single page request or do you just log totals
per day, week, or month?


You're going to get as many answers as respondants. Some people find raw
stats more valuable (because you can pinpoint a specific request and all

the information about that single event, and you can also apply aggregates to
get sums by date range(s)), others conserve disk space (and processing, to
some degree) by just storing aggregates.
How do you deal with the increasing volumes of
data?


Sound database design.
Do you collect referrer data, etc.?


Again, this really depends. I don't think a survey is going to tell you
what information you're interested in... maybe you can tell us what your
requirements are.

Jul 19 '05 #3
Gazing into my crystal ball I observed "Paul Woods"
<paul@flyingpylon-dot-com> writing in
news:Ot**************@TK2MSFTNGP10.phx.gbl:
I'm developing an application that uses a custom 404 page to deliver
all of my site's content. However, doing things this way renders IIS's
regular log files pretty much useless.

Are there any established "best practices" for creating your own
logging system? I know that others use this technique and I'm hoping
someone has some ideas they can pass along.

For example, do you log every single page request or do you just log
totals per day, week, or month? How do you deal with the increasing
volumes of data? Do you collect referrer data, etc.?

Thanks,

Paul


I'm using my own system because my former host did not provide access to
the raw logs.

Here's what I collect: date, time, ip, url, referer, host (since there is
more than one domain name), querystring, and user agent

I find referer to be very interesting, as it tells me what keywords a
visitor used coming from a search engine. I also like user agent, because
it call tell me what spiders are coming around, and if need to block them
if they are not well behaved.

Right now, I only keep one month of data stored in the table, and create a
new table at the beginning of each month. If the traffic gets larger, I
might think about reducing to one week, and archiving the old tables in
another database.

If you have access to the raw logs, make sure that you are collecting
referer information. If you need a good analyzer, I think that
http://www.surfstats.com is quite good, although not free.

--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
Jul 19 '05 #4
> When I asked about how to deal with increasing volumes of data, you
answered
"sound database design". Do you have any examples?


I don't really have any generic examples of "sound database design"... it's
just a matter of proper normalization and designing your tables correctly
for the information you want to store, and not designing them for the
information you don't care about. Depending on the needs of the
application, it might be that you want the design optimized for INSERT
performance, and the people querying the data can suffer a little worse
performance for it. Or, it might be that the people querying the data are
more demanding (or it happens more) so that is where you should spend your
time focusing on efficiency of design. I really don't know. But I can
suggest at least a couple of ways to prevent such an app from chewing disk
space all day and night (at slight query performance costs).

For log applications in particular, there is often a whole lot of useless /
redundant information. One thing is that a lot of people store the entire
user agent string in every single row. What we did in one application is
have a set of *common* browsers, taught our application how to lump them
into categories, and stored their representation instead. So we had a table
with a TINYINT column and a VARCHAR(32) column, which stored the "browser
map" (about 20 rows) and then only stored the tinyint value with the large
set of data. This reduced the large fact tables from a VARCHAR(255) to a
TINYINT, so a savings of 254 bytes per row. Basically:

CREATE TABLE BrowserMap
(
BrowserMapID TINYINT
PRIMARY KEY CLUSTERED
BrowserName VARCHAR(32)
)

CREATE TABLE RawLog
(
RawLogID INT IDENTITY(1, 1)
PRIMARY KEY NONCLUSTERED,
dtEvent DATETIME NOT NULL,
BrowserMapID TINYINT FOREIGN KEY
REFERENCES BrowserMap(BrowserMapID),
...
)

Another thing we did is store the IP address in four TINYINT columns, rather
than a big VARCHAR(15). There is a discussion about various ways to reduce
storage space for an IP in http://www.aspfaq.com/2450, and some general
database efficiency suggestions at http://www.aspfaq.com/2424#db
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andreas Jung | last post by:
I am trying to write a custom logger with a custom handler: class MyHandler(StreamHandler): pass class Logger: def __init__(self): self._l = logging.getLogger('someident')...
0
by: Joe Bloggs | last post by:
Hi all, I take the pleasure to inform that Dotnet Commons Logging has been released for use. Dotnet Commons Logging, a subproject of the Donet Commons project currently located under the...
1
by: Ollie Riches | last post by:
I have written a custom logging sink for the enterprise library logging application block (June 2005). I have been able to configure it as expected from the UI config tool (EntLibConfig.exe). I...
1
by: marcstober | last post by:
Hi -- I'm trying to write a class that will work like a StreamWriter, but will direct output into two different places, such as a GUI along with either a text file or database table. My first...
0
by: Søren Lund | last post by:
Hello, I have implemented a custom config section handler by implementing the IConfigurationSectionHandler interface. I have registered this handler in web.config and everything works fine ......
2
by: Galore | last post by:
Hello, I have the situation: I've got an application that calls lots of web services, throught the Internet. I need to keep track of every web service call (every data that's transfered), and...
2
by: prabhupr | last post by:
Hi Folks I was reading this article (http://www.dotnetbips.com/articles/displayarticle.aspx?id=32) on "Custom Attribute", written by Bipin. The only thing I did not understand in this article...
9
by: Rasika WIJAYARATNE | last post by:
Hi guys, Please check this out: http://rkwcoding.blogspot.com/2007/07/error-logging.html
3
by: Dave Anson | last post by:
I have a custom exception and I want to write the information to the event log, including the Stack Trace. I can create the message and write to the event log no problem, but the Stack Trace is...
3
by: Lowell Alleman | last post by:
Here is the situation: I wrote my own log handler class (derived from logging.Handler) and I want to be able to use it from a logging config file, that is, a config file loaded with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.