-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTailCFLogFile.bat
66 lines (56 loc) · 1.55 KB
/
TailCFLogFile.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
setlocal
:begin
cls
echo Which log would you like to tail?
echo.
echo 1) ColdFusion Console Log
echo 2) ColdFusion Error Log
echo 3) ColdFusion Exception Log
echo 4) ColdFusion Application Log
echo.
choice /c 12345 /n /t 30 /d 1 /m "Pick a log file:"
set pick=%errorlevel%
set goto=0
if %pick% == 4 (
title ColdFusion Application Log
set goto=4
)
if %pick% == 3 (
title ColdFusion Exception Log
set goto=3
)
if %pick% == 2 (
title ColdFusion Error Log
set goto=2
)
if %pick% == 1 (
title ColdFusion Console Log
set goto=1
)
goto %goto%
:::::::::::::::::::::::::::::::::::::::::::::::
:0
goto :eof
:1
:: ColdFusion Console Log
powershell.exe -Command "Get-Content -Path 'C:\\CF2016Exp\cfusion\logs\coldfusion-out.log' -Wait"
:: -Tail 20"
goto :eof
:2
:: ColdFusion Error Log
powershell.exe -Command "Get-Content -Path 'C:\\CF2016Exp\cfusion\logs\coldfusion-error.log' -Wait"
goto :eof
:3
:: ColdFusion Exception Log
powershell.exe -Command "Get-Content -Path 'C:\\CF2016Exp\cfusion\logs\exception.log' -Wait"
goto :eof
:4
:: ColdFusion Application Log
powershell.exe -Command "Get-Content -Path 'C:\\CF2016Exp\cfusion\logs\application.log' -Wait"
goto :eof
::NOTES
::CHOICE doesn't work in some versions of Windows, like NT4, 200 and XP.
::ERRORLEVEL is the offset value of the index of the key that was selected
::ERRORLEVEL 255 == error in the CHOICE itself ; ERRORLEVEL 0 == CTRL+BREAK and CTRL+C
::Use Decreasing Order to pick the appropriate value. ERRORLEVEL will check TRUE for all previous values.