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%>
[ 08-07-2024 19:10:37 ]     A visitor from 52.230.152.219
[ 10-07-2024 05:37:20 ]     A visitor from 52.230.152.186
[ 10-07-2024 06:58:37 ]     A visitor from 52.230.152.55
[ 10-07-2024 07:58:11 ]     A visitor from 52.230.152.92
[ 10-07-2024 10:58:14 ]     A visitor from 114.119.145.205
[ 10-07-2024 16:07:04 ]     A visitor from 195.201.174.92
[ 10-07-2024 17:35:38 ]     A visitor from 195.201.174.92
[ 11-07-2024 11:09:11 ]     A visitor from 52.230.152.167
[ 11-07-2024 14:54:54 ]     A visitor from 92.204.40.4
[ 11-07-2024 22:20:03 ]     A visitor from 51.68.165.201
[ 12-07-2024 06:50:42 ]     A visitor from 217.113.194.32
[ 13-07-2024 06:45:57 ]     A visitor from 114.119.158.251
[ 13-07-2024 12:33:38 ]     A visitor from 114.119.157.146
[ 19-07-2024 21:20:05 ]     A visitor from 54.36.148.206
[ 19-07-2024 22:35:24 ]     A visitor from 54.36.148.216
[ 20-07-2024 12:29:09 ]     A visitor from 66.249.69.172
[ 20-07-2024 17:23:15 ]     A visitor from 85.208.96.208
[ 20-07-2024 17:26:07 ]     A visitor from 185.191.171.6
[ 21-07-2024 00:54:57 ]     A visitor from 66.249.69.173
[ 21-07-2024 07:24:13 ]     A visitor from 85.208.96.195
[ 22-07-2024 09:09:30 ]     A visitor from 54.36.148.179
[ 22-07-2024 12:34:24 ]     A visitor from 114.119.135.37
[ 23-07-2024 02:57:35 ]     A visitor from 69.171.249.1
[ 24-07-2024 04:40:17 ]     A visitor from 185.229.119.178
[ 26-07-2024 02:33:21 ]     A visitor from 85.208.96.201
[ 26-07-2024 18:33:07 ]     A visitor from 65.21.35.203
[ 26-07-2024 22:35:10 ]     A visitor from 217.113.194.38
[ 27-07-2024 09:54:50 ]     A visitor from 54.36.148.187
[ 27-07-2024 10:31:30 ]     A visitor from 193.70.81.126
[ 27-07-2024 22:45:20 ]     A visitor from 216.244.66.229
[ 28-07-2024 04:00:59 ]     A visitor from 37.57.218.243
[ 28-07-2024 14:55:32 ]     A visitor from 66.249.70.107
[ 29-07-2024 14:59:05 ]     A visitor from 192.95.29.138
[ 29-07-2024 16:28:27 ]     A visitor from 54.36.148.164
[ 31-07-2024 06:11:42 ]     A visitor from 178.151.245.162
[ 31-07-2024 11:53:58 ]     A visitor from 85.208.96.206
[ 31-07-2024 18:10:04 ]     A visitor from 217.113.194.78
[ 31-07-2024 19:09:35 ]     A visitor from 85.208.96.208
[ 31-07-2024 20:01:52 ]     A visitor from 85.25.185.20
[ 01-08-2024 04:25:39 ]     A visitor from 217.113.194.34
[ 01-08-2024 04:59:31 ]     A visitor from 52.230.152.63
[ 01-08-2024 07:39:34 ]     A visitor from 54.36.149.85
[ 02-08-2024 13:29:12 ]     A visitor from 217.182.175.125
[ 02-08-2024 13:42:52 ]     A visitor from 85.25.185.20
[ 02-08-2024 22:36:10 ]     A visitor from 173.252.107.113
[ 03-08-2024 04:03:02 ]     A visitor from 54.36.149.45
[ 03-08-2024 04:10:48 ]     A visitor from 85.208.96.211
[ 04-08-2024 00:10:45 ]     A visitor from 54.36.149.83
[ 05-08-2024 14:45:06 ]     A visitor from 85.208.96.194
[ 06-08-2024 00:21:43 ]     A visitor from 85.208.96.193
[ 06-08-2024 08:10:52 ]     A visitor from 217.113.194.75
[ 06-08-2024 08:15:29 ]     A visitor from 217.113.194.75
[ 06-08-2024 22:31:04 ]     A visitor from 136.243.220.213
[ 07-08-2024 18:19:29 ]     A visitor from 69.171.249.11
[ 08-08-2024 06:23:22 ]     A visitor from 66.249.70.108
[ 08-08-2024 07:34:46 ]     A visitor from 135.181.137.62
[ 08-08-2024 11:12:17 ]     A visitor from 69.171.230.5
[ 08-08-2024 12:41:26 ]     A visitor from 85.25.185.20
[ 09-08-2024 06:51:54 ]     A visitor from 173.252.83.112
[ 10-08-2024 13:13:10 ]     A visitor from 173.252.107.116
[ 10-08-2024 20:43:10 ]     A visitor from 85.208.96.204
[ 10-08-2024 22:02:18 ]     A visitor from 85.208.96.198
[ 11-08-2024 05:30:40 ]     A visitor from 185.191.171.9
[ 12-08-2024 05:04:49 ]     A visitor from 154.54.249.196
[ 13-08-2024 04:02:48 ]     A visitor from 178.151.245.162
[ 13-08-2024 19:43:46 ]     A visitor from 207.46.13.141
[ 14-08-2024 05:49:09 ]     A visitor from 57.141.0.23
[ 14-08-2024 14:29:09 ]     A visitor from 57.141.0.22
[ 14-08-2024 16:23:57 ]     A visitor from 57.141.0.1
[ 15-08-2024 14:49:01 ]     A visitor from 173.252.107.116
[ 15-08-2024 16:03:33 ]     A visitor from 173.252.83.41
[ 16-08-2024 00:58:15 ]     A visitor from 173.252.83.28
[ 16-08-2024 17:41:19 ]     A visitor from 65.108.78.33
[ 16-08-2024 17:58:08 ]     A visitor from 57.141.0.18
[ 16-08-2024 20:38:17 ]     A visitor from 216.244.66.230
[ 16-08-2024 20:42:40 ]     A visitor from 57.141.0.18
[ 17-08-2024 19:30:59 ]     A visitor from 217.113.194.79
[ 18-08-2024 04:33:56 ]     A visitor from 158.220.124.129
[ 18-08-2024 04:37:40 ]     A visitor from 54.36.148.69
[ 18-08-2024 06:33:00 ]     A visitor from 54.36.148.126
[ 18-08-2024 22:20:07 ]     A visitor from 40.77.167.247
[ 19-08-2024 07:23:18 ]     A visitor from 216.244.66.230
[ 19-08-2024 12:07:34 ]     A visitor from 52.70.240.171
[ 19-08-2024 19:19:59 ]     A visitor from 47.128.19.130
[ 21-08-2024 13:07:38 ]     A visitor from 173.252.83.41
[ 21-08-2024 14:25:05 ]     A visitor from 85.208.96.209
[ 21-08-2024 17:41:32 ]     A visitor from 185.191.171.7
[ 21-08-2024 18:00:44 ]     A visitor from 173.252.107.112
[ 21-08-2024 18:17:51 ]     A visitor from 185.191.171.12
[ 21-08-2024 20:12:20 ]     A visitor from 69.171.249.114
[ 22-08-2024 00:07:33 ]     A visitor from 85.208.96.193
[ 22-08-2024 08:19:35 ]     A visitor from 85.25.185.20
[ 22-08-2024 14:12:59 ]     A visitor from 85.25.185.20
[ 22-08-2024 23:09:42 ]     A visitor from 159.138.111.237
[ 23-08-2024 21:24:06 ]     A visitor from 54.36.148.71
[ 24-08-2024 04:32:08 ]     A visitor from 54.36.148.11
[ 24-08-2024 19:05:42 ]     A visitor from 114.119.152.46
[ 25-08-2024 06:15:10 ]     A visitor from 52.167.144.184
[ 25-08-2024 23:39:50 ]     A visitor from 166.108.229.31
[ 26-08-2024 15:54:01 ]     A visitor from 167.172.100.234
[ 26-08-2024 23:38:20 ]     A visitor from 54.36.148.51
[ 27-08-2024 00:38:28 ]     A visitor from 111.119.211.96
[ 27-08-2024 03:24:21 ]     A visitor from 185.191.171.6
[ 27-08-2024 10:02:05 ]     A visitor from 85.208.96.195
[ 28-08-2024 18:32:27 ]     A visitor from 54.36.148.172
[ 29-08-2024 05:24:08 ]     A visitor from 217.113.194.76
[ 29-08-2024 22:06:42 ]     A visitor from 213.180.203.64
[ 30-08-2024 01:29:12 ]     A visitor from 57.141.0.24
[ 30-08-2024 01:53:02 ]     A visitor from 66.220.149.115
[ 30-08-2024 08:59:05 ]     A visitor from 130.226.228.74
[ 30-08-2024 10:13:19 ]     A visitor from 54.36.148.178
[ 30-08-2024 21:06:06 ]     A visitor from 130.226.228.74
[ 31-08-2024 02:25:54 ]     A visitor from 66.249.66.36
[ 31-08-2024 03:35:51 ]     A visitor from 66.249.66.35
[ 31-08-2024 06:05:42 ]     A visitor from 66.249.66.36
[ 31-08-2024 06:43:35 ]     A visitor from 66.249.66.36
[ 31-08-2024 07:10:32 ]     A visitor from 85.25.185.20
[ 31-08-2024 07:34:22 ]     A visitor from 66.249.66.36
[ 31-08-2024 08:51:00 ]     A visitor from 66.249.66.37
[ 31-08-2024 12:56:59 ]     A visitor from 94.23.203.107
[ 02-09-2024 04:46:44 ]     A visitor from 52.167.144.235
[ 02-09-2024 06:37:25 ]     A visitor from 54.36.148.111
[ 02-09-2024 19:29:59 ]     A visitor from 217.113.194.36
[ 03-09-2024 14:24:45 ]     A visitor from 94.23.7.187
[ 04-09-2024 12:55:27 ]     A visitor from 57.141.0.19
[ 04-09-2024 12:58:09 ]     A visitor from 57.141.0.5
[ 05-09-2024 18:54:22 ]     A visitor from 54.36.148.163
[ 06-09-2024 01:14:34 ]     A visitor from 54.36.148.38
[ 06-09-2024 01:58:15 ]     A visitor from 54.36.148.227
[ 06-09-2024 02:12:14 ]     A visitor from 54.36.148.216
[ 06-09-2024 07:20:19 ]     A visitor from 130.226.228.74
[ 06-09-2024 08:21:00 ]     A visitor from 54.36.149.59
[ 06-09-2024 11:07:51 ]     A visitor from 54.36.148.74
[ 06-09-2024 12:04:43 ]     A visitor from 185.191.171.4
[ 06-09-2024 13:12:13 ]     A visitor from 85.208.96.196
[ 06-09-2024 19:28:49 ]     A visitor from 130.226.228.74
[ 08-09-2024 02:28:02 ]     A visitor from 217.113.194.34
[ 08-09-2024 02:28:18 ]     A visitor from 217.113.194.41
[ 08-09-2024 02:59:46 ]     A visitor from 92.204.54.123
[ 08-09-2024 17:25:35 ]     A visitor from 54.36.148.157
[ 09-09-2024 02:22:22 ]     A visitor from 54.36.149.53
[ 11-09-2024 12:39:33 ]     A visitor from 173.252.83.4
[ 11-09-2024 13:51:55 ]     A visitor from 57.141.0.18
[ 11-09-2024 22:50:07 ]     A visitor from 57.141.0.21
[ 11-09-2024 23:01:22 ]     A visitor from 57.141.0.26
[ 11-09-2024 23:51:55 ]     A visitor from 47.128.21.187
[ 13-09-2024 00:37:22 ]     A visitor from 207.246.100.87
[ 13-09-2024 08:10:16 ]     A visitor from 217.113.194.38
[ 13-09-2024 08:12:04 ]     A visitor from 217.113.194.35
[ 13-09-2024 22:00:05 ]     A visitor from 54.36.148.185
[ 14-09-2024 01:03:20 ]     A visitor from 47.128.51.6
[ 14-09-2024 12:04:26 ]     A visitor from 57.141.0.28
[ 14-09-2024 12:10:06 ]     A visitor from 173.252.87.112
[ 14-09-2024 15:48:14 ]     A visitor from 47.128.126.147
[ 14-09-2024 16:02:39 ]     A visitor from 54.36.148.167
[ 14-09-2024 16:29:14 ]     A visitor from 54.36.148.2
[ 14-09-2024 16:54:47 ]     A visitor from 54.36.148.133
[ 15-09-2024 03:29:05 ]     A visitor from 216.244.66.229
[ 15-09-2024 03:40:32 ]     A visitor from 217.113.194.79
[ 15-09-2024 11:33:50 ]     A visitor from 3.223.44.119
[ 16-09-2024 00:36:13 ]     A visitor from 54.36.149.77
[ 16-09-2024 01:00:37 ]     A visitor from 54.36.149.74
[ 16-09-2024 12:23:13 ]     A visitor from 44.192.26.226

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>