Using ToLogFile()

Contents of this folder :

Here are the contents of "logs/mylog.txt" file: (deleted when filesize > 20000 bytes)
<%response.write("Ahem ... you have nothing to do here!!")
response.end%>
[ 22-11-2024 07:41:27 ]     A visitor from 54.36.148.163
[ 22-11-2024 10:51:12 ]     A visitor from 135.181.138.3
[ 22-11-2024 10:53:04 ]     A visitor from 54.36.149.58
[ 22-11-2024 17:28:13 ]     A visitor from 57.141.0.25
[ 23-11-2024 17:59:39 ]     A visitor from 54.36.149.80
[ 23-11-2024 18:12:41 ]     A visitor from 54.36.149.106
[ 24-11-2024 13:42:25 ]     A visitor from 216.244.66.230
[ 24-11-2024 15:15:06 ]     A visitor from 3.17.155.142
[ 25-11-2024 02:59:56 ]     A visitor from 85.25.210.23
[ 25-11-2024 16:37:24 ]     A visitor from 57.141.0.20
[ 25-11-2024 17:27:29 ]     A visitor from 52.73.6.26
[ 25-11-2024 19:42:26 ]     A visitor from 85.25.210.23
[ 26-11-2024 06:38:12 ]     A visitor from 34.70.124.203
[ 26-11-2024 06:40:56 ]     A visitor from 34.70.124.203
[ 27-11-2024 15:34:46 ]     A visitor from 217.113.194.77
[ 27-11-2024 15:42:43 ]     A visitor from 85.208.96.196
[ 27-11-2024 16:36:43 ]     A visitor from 57.141.0.20
[ 27-11-2024 17:51:34 ]     A visitor from 85.208.96.195
[ 27-11-2024 20:33:49 ]     A visitor from 130.226.228.87
[ 28-11-2024 02:08:16 ]     A visitor from 114.119.151.103
[ 29-11-2024 06:00:48 ]     A visitor from 54.36.149.38
[ 29-11-2024 06:28:24 ]     A visitor from 54.36.148.145
[ 29-11-2024 18:51:07 ]     A visitor from 54.36.148.121
[ 29-11-2024 19:13:52 ]     A visitor from 40.77.167.33
[ 29-11-2024 20:06:41 ]     A visitor from 57.141.0.20
[ 29-11-2024 23:33:38 ]     A visitor from 54.36.148.84
[ 30-11-2024 03:12:13 ]     A visitor from 54.36.148.68
[ 30-11-2024 06:10:53 ]     A visitor from 54.36.148.100
[ 02-12-2024 01:50:12 ]     A visitor from 185.191.171.4
[ 02-12-2024 08:40:01 ]     A visitor from 85.208.96.204
[ 02-12-2024 10:38:46 ]     A visitor from 54.36.148.113
[ 02-12-2024 11:00:24 ]     A visitor from 54.36.149.6
[ 03-12-2024 07:07:59 ]     A visitor from 114.119.152.54
[ 03-12-2024 18:30:20 ]     A visitor from 217.113.194.81
[ 03-12-2024 18:35:15 ]     A visitor from 217.113.194.81
[ 04-12-2024 18:31:01 ]     A visitor from 188.138.9.93
[ 06-12-2024 13:49:23 ]     A visitor from 149.202.86.190
[ 06-12-2024 16:21:15 ]     A visitor from 57.141.0.6
[ 07-12-2024 01:58:45 ]     A visitor from 185.191.171.18
[ 07-12-2024 09:18:51 ]     A visitor from 217.113.194.35
[ 07-12-2024 13:02:22 ]     A visitor from 85.208.96.203
[ 07-12-2024 14:32:16 ]     A visitor from 54.36.148.237
[ 07-12-2024 18:04:53 ]     A visitor from 54.36.149.70
[ 07-12-2024 18:24:24 ]     A visitor from 57.141.0.21
[ 07-12-2024 21:56:24 ]     A visitor from 54.36.149.6
[ 07-12-2024 22:22:38 ]     A visitor from 51.222.253.5
[ 07-12-2024 22:35:06 ]     A visitor from 54.36.148.145
[ 08-12-2024 00:08:25 ]     A visitor from 51.222.253.5
[ 10-12-2024 16:43:12 ]     A visitor from 57.141.0.7
[ 11-12-2024 01:37:33 ]     A visitor from 54.36.148.101
[ 11-12-2024 01:44:54 ]     A visitor from 54.36.149.85
[ 11-12-2024 10:02:54 ]     A visitor from 85.25.210.23
[ 12-12-2024 01:46:29 ]     A visitor from 185.191.171.2
[ 12-12-2024 01:48:55 ]     A visitor from 85.208.96.193
[ 12-12-2024 03:03:29 ]     A visitor from 85.25.93.236
[ 12-12-2024 04:27:21 ]     A visitor from 85.208.96.196
[ 12-12-2024 12:33:38 ]     A visitor from 185.191.171.5
[ 12-12-2024 13:01:00 ]     A visitor from 185.191.171.5
[ 12-12-2024 14:09:52 ]     A visitor from 85.208.96.205
[ 13-12-2024 20:04:42 ]     A visitor from 17.241.219.132
[ 14-12-2024 02:03:23 ]     A visitor from 217.113.194.35
[ 14-12-2024 06:04:21 ]     A visitor from 100.27.153.9
[ 14-12-2024 19:36:09 ]     A visitor from 35.170.205.140
[ 15-12-2024 07:45:23 ]     A visitor from 54.36.148.254
[ 15-12-2024 08:02:23 ]     A visitor from 51.83.224.227
[ 15-12-2024 10:05:36 ]     A visitor from 54.36.148.48
[ 15-12-2024 10:38:23 ]     A visitor from 85.25.93.236
[ 15-12-2024 19:09:06 ]     A visitor from 54.36.148.162
[ 15-12-2024 19:25:23 ]     A visitor from 54.36.148.117
[ 16-12-2024 10:10:53 ]     A visitor from 54.36.148.83
[ 16-12-2024 11:29:59 ]     A visitor from 216.244.66.229
[ 16-12-2024 13:29:57 ]     A visitor from 54.36.148.137
[ 17-12-2024 16:06:43 ]     A visitor from 3.223.44.119
[ 19-12-2024 12:00:52 ]     A visitor from 54.36.148.180
[ 19-12-2024 12:17:32 ]     A visitor from 54.36.148.195
[ 20-12-2024 08:56:01 ]     A visitor from 62.138.2.214
[ 20-12-2024 14:32:55 ]     A visitor from 144.76.67.110
[ 20-12-2024 14:40:07 ]     A visitor from 144.76.67.110
[ 22-12-2024 13:00:19 ]     A visitor from 185.191.171.8
[ 22-12-2024 19:15:00 ]     A visitor from 85.208.96.199
[ 22-12-2024 22:32:45 ]     A visitor from 217.113.194.74
[ 22-12-2024 22:39:00 ]     A visitor from 217.113.194.78
[ 22-12-2024 22:43:20 ]     A visitor from 217.113.194.79
[ 22-12-2024 22:54:10 ]     A visitor from 54.36.149.40
[ 23-12-2024 01:16:23 ]     A visitor from 54.36.149.26
[ 23-12-2024 08:29:03 ]     A visitor from 216.244.66.230
[ 23-12-2024 13:27:52 ]     A visitor from 54.36.148.219
[ 23-12-2024 15:17:23 ]     A visitor from 54.36.148.231
[ 23-12-2024 21:48:02 ]     A visitor from 62.138.3.52
[ 23-12-2024 22:56:04 ]     A visitor from 114.119.138.185
[ 24-12-2024 19:42:27 ]     A visitor from 135.181.212.177
[ 24-12-2024 23:11:48 ]     A visitor from 54.36.148.149
[ 25-12-2024 12:31:27 ]     A visitor from 54.36.148.164
[ 26-12-2024 09:14:38 ]     A visitor from 52.6.97.88
[ 26-12-2024 20:55:11 ]     A visitor from 62.138.2.160
[ 27-12-2024 23:41:17 ]     A visitor from 85.208.96.212
[ 28-12-2024 12:01:41 ]     A visitor from 85.208.96.199
[ 29-12-2024 18:23:58 ]     A visitor from 57.141.0.18
[ 30-12-2024 23:15:50 ]     A visitor from 54.36.149.99
[ 30-12-2024 23:24:00 ]     A visitor from 54.36.148.69
[ 31-12-2024 03:00:27 ]     A visitor from 217.182.175.146
[ 31-12-2024 05:25:54 ]     A visitor from 217.113.194.36
[ 31-12-2024 05:26:40 ]     A visitor from 217.113.194.41
[ 31-12-2024 14:07:50 ]     A visitor from 54.36.148.40
[ 31-12-2024 14:56:05 ]     A visitor from 54.36.148.195
[ 31-12-2024 18:21:16 ]     A visitor from 54.36.148.232
[ 31-12-2024 18:58:42 ]     A visitor from 54.36.149.64
[ 01-01-2025 01:28:39 ]     A visitor from 34.44.132.45
[ 01-01-2025 07:05:28 ]     A visitor from 34.66.184.90
[ 01-01-2025 07:06:20 ]     A visitor from 34.66.184.90
[ 01-01-2025 12:15:49 ]     A visitor from 65.108.125.120
[ 01-01-2025 21:19:44 ]     A visitor from 81.167.26.57
[ 02-01-2025 03:10:16 ]     A visitor from 57.141.0.2
[ 02-01-2025 12:21:30 ]     A visitor from 135.181.85.180
[ 02-01-2025 13:08:34 ]     A visitor from 85.208.96.202
[ 02-01-2025 15:26:57 ]     A visitor from 54.36.148.172
[ 02-01-2025 18:44:49 ]     A visitor from 85.208.96.205
[ 03-01-2025 05:34:14 ]     A visitor from 54.36.148.36
[ 03-01-2025 08:16:35 ]     A visitor from 62.84.178.152
[ 03-01-2025 23:44:30 ]     A visitor from 154.54.249.200
[ 04-01-2025 00:02:25 ]     A visitor from 217.113.194.76
[ 04-01-2025 06:34:29 ]     A visitor from 135.181.180.59
[ 05-01-2025 08:35:35 ]     A visitor from 178.25.244.194
[ 06-01-2025 00:27:26 ]     A visitor from 136.243.220.213
[ 06-01-2025 06:31:04 ]     A visitor from 114.119.159.26
[ 07-01-2025 05:00:50 ]     A visitor from 91.137.27.140
[ 08-01-2025 06:25:56 ]     A visitor from 114.119.152.12
[ 08-01-2025 08:12:21 ]     A visitor from 66.249.66.162
[ 08-01-2025 08:42:19 ]     A visitor from 66.249.66.162
[ 08-01-2025 11:14:43 ]     A visitor from 66.249.66.162
[ 08-01-2025 11:18:58 ]     A visitor from 66.249.66.165
[ 08-01-2025 13:58:12 ]     A visitor from 54.36.148.167
[ 08-01-2025 14:40:21 ]     A visitor from 54.36.148.193
[ 08-01-2025 15:19:29 ]     A visitor from 54.36.149.36
[ 08-01-2025 16:14:31 ]     A visitor from 54.36.148.199
[ 08-01-2025 16:38:18 ]     A visitor from 54.36.149.43
[ 08-01-2025 19:09:04 ]     A visitor from 54.36.148.196
[ 08-01-2025 19:38:27 ]     A visitor from 54.36.148.191
[ 09-01-2025 03:33:06 ]     A visitor from 65.108.78.33
[ 09-01-2025 05:05:32 ]     A visitor from 94.23.203.86
[ 09-01-2025 16:54:51 ]     A visitor from 85.208.96.198
[ 09-01-2025 17:57:14 ]     A visitor from 185.191.171.9
[ 11-01-2025 08:12:32 ]     A visitor from 66.249.66.164
[ 11-01-2025 09:53:07 ]     A visitor from 188.165.217.198
[ 11-01-2025 14:55:45 ]     A visitor from 54.36.149.70
[ 11-01-2025 23:10:41 ]     A visitor from 114.119.146.229
[ 12-01-2025 02:33:28 ]     A visitor from 54.36.149.15
[ 13-01-2025 22:51:05 ]     A visitor from 57.141.0.4
[ 14-01-2025 21:28:28 ]     A visitor from 185.191.171.15
[ 15-01-2025 05:19:14 ]     A visitor from 18.219.119.163

Here are the contents of 'default.asp':
<!-- The includefile is one level back from the "default.asp" file: -->
<!--#include file ="../../jakes_IO.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="da">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Example use of the ToLogFile function</title>
    <link rel="stylesheet" type="text/css" href="/jake.css">
</head>
<body>
    <div align="center"><h1>Using ToLogFile()</h1></div>
    <b>Contents of this folder :</b><br>
    <% dim logstring
    
    logstring = "A visitor from " & request.servervariables("REMOTE_ADDR") & " "
    select case request.querystring("action")
        case "Button 1"
            logstring = logstring & "pressed button1"
        case "Button 2"
            logstring = logstring & "pressed button2"
        case "Button 3"
            logstring = logstring & "pressed button3"
        case "Say hello"
            logstring = logstring & "said 'Hello': )"
        case "Say bye"
            logstring = logstring & "said 'Bye': )"
        end select
        
        tologfile "logs/mylog.txt", logstring
        %>
    <form method="get" action="default.asp?action=button1"><input type="submit" name="action" value="Button 1">
    <input type="submit" name="action" value="Button 2">
    <input type="submit" name="action" value="Button 3">
    <input type="submit" name="action" value="Say hello">
    <input type="submit" name="action" value="Say bye">
    </form>
    
    <p><b>Here are the contents of "logs/mylog.txt" file:</b> (deleted when filesize > 20000 bytes)
    <br><span style="display:block;border:1px solid black;background:#DEF;padding:10px;font-size:11px;">
    <%
        response.write(stringToHTML(getFileContents("logs/mylog.txt")))
        if getsize("logs/mylog.txt") > 20000 then delete("logs/mylog.txt")
    %>
    </span>

    <p><b>Here are the contents of 'default.asp':</b>
    <br><span style="display:block;border:1px solid black;background:#FDE;padding:10px;font-size:11px;">
    <%
        response.write(stringToHTML(getFileContents("default.asp")))
    %>
    </span>


</body>
</html>