Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
44e3a97a
Commit
44e3a97a
authored
Feb 24, 2019
by
Toby Allen
Committed by
Matt Holt
Feb 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Modify Startup Output (#2469)" (#2482)
This reverts commit
c0190a34
.
parent
c0190a34
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
31 deletions
+10
-31
caddy.go
caddy.go
+0
-3
caddy/caddymain/run.go
caddy/caddymain/run.go
+6
-5
caddyhttp/httpserver/server.go
caddyhttp/httpserver/server.go
+4
-23
No files found.
caddy.go
View file @
44e3a97a
...
@@ -74,9 +74,6 @@ var (
...
@@ -74,9 +74,6 @@ var (
// false after that.
// false after that.
started
bool
started
bool
// record where the process log is being sent
LogDestination
string
// mu protects the variables 'isUpgrade' and 'started'.
// mu protects the variables 'isUpgrade' and 'started'.
mu
sync
.
Mutex
mu
sync
.
Mutex
)
)
...
...
caddy/caddymain/run.go
View file @
44e3a97a
...
@@ -58,7 +58,7 @@ func init() {
...
@@ -58,7 +58,7 @@ func init() {
flag
.
BoolVar
(
&
plugins
,
"plugins"
,
false
,
"List installed plugins"
)
flag
.
BoolVar
(
&
plugins
,
"plugins"
,
false
,
"List installed plugins"
)
flag
.
StringVar
(
&
certmagic
.
Email
,
"email"
,
""
,
"Default ACME CA account email address"
)
flag
.
StringVar
(
&
certmagic
.
Email
,
"email"
,
""
,
"Default ACME CA account email address"
)
flag
.
DurationVar
(
&
certmagic
.
HTTPTimeout
,
"catimeout"
,
certmagic
.
HTTPTimeout
,
"Default ACME CA HTTP timeout"
)
flag
.
DurationVar
(
&
certmagic
.
HTTPTimeout
,
"catimeout"
,
certmagic
.
HTTPTimeout
,
"Default ACME CA HTTP timeout"
)
flag
.
StringVar
(
&
caddy
.
LogDestination
,
"log"
,
""
,
"Process log file"
)
flag
.
StringVar
(
&
logfile
,
"log"
,
""
,
"Process log file"
)
flag
.
IntVar
(
&
logRollMB
,
"log-roll-mb"
,
100
,
"Roll process log when it reaches this many megabytes (0 to disable rolling)"
)
flag
.
IntVar
(
&
logRollMB
,
"log-roll-mb"
,
100
,
"Roll process log when it reaches this many megabytes (0 to disable rolling)"
)
flag
.
BoolVar
(
&
logRollCompress
,
"log-roll-compress"
,
true
,
"Gzip-compress rolled process log files"
)
flag
.
BoolVar
(
&
logRollCompress
,
"log-roll-compress"
,
true
,
"Gzip-compress rolled process log files"
)
flag
.
StringVar
(
&
caddy
.
PidFile
,
"pidfile"
,
""
,
"Path to write pid file"
)
flag
.
StringVar
(
&
caddy
.
PidFile
,
"pidfile"
,
""
,
"Path to write pid file"
)
...
@@ -82,7 +82,7 @@ func Run() {
...
@@ -82,7 +82,7 @@ func Run() {
certmagic
.
UserAgent
=
appName
+
"/"
+
appVersion
certmagic
.
UserAgent
=
appName
+
"/"
+
appVersion
// Set up process log before anything bad happens
// Set up process log before anything bad happens
switch
caddy
.
LogDestination
{
switch
logfile
{
case
"stdout"
:
case
"stdout"
:
log
.
SetOutput
(
os
.
Stdout
)
log
.
SetOutput
(
os
.
Stdout
)
case
"stderr"
:
case
"stderr"
:
...
@@ -92,18 +92,18 @@ func Run() {
...
@@ -92,18 +92,18 @@ func Run() {
default
:
default
:
if
logRollMB
>
0
{
if
logRollMB
>
0
{
log
.
SetOutput
(
&
lumberjack
.
Logger
{
log
.
SetOutput
(
&
lumberjack
.
Logger
{
Filename
:
caddy
.
LogDestination
,
Filename
:
logfile
,
MaxSize
:
logRollMB
,
MaxSize
:
logRollMB
,
MaxAge
:
14
,
MaxAge
:
14
,
MaxBackups
:
10
,
MaxBackups
:
10
,
Compress
:
logRollCompress
,
Compress
:
logRollCompress
,
})
})
}
else
{
}
else
{
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
caddy
.
LogDestination
),
0755
)
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
logfile
),
0755
)
if
err
!=
nil
{
if
err
!=
nil
{
mustLogFatalf
(
"%v"
,
err
)
mustLogFatalf
(
"%v"
,
err
)
}
}
f
,
err
:=
os
.
OpenFile
(
caddy
.
LogDestination
,
os
.
O_APPEND
|
os
.
O_CREATE
|
os
.
O_WRONLY
,
0644
)
f
,
err
:=
os
.
OpenFile
(
logfile
,
os
.
O_APPEND
|
os
.
O_CREATE
|
os
.
O_WRONLY
,
0644
)
if
err
!=
nil
{
if
err
!=
nil
{
mustLogFatalf
(
"%v"
,
err
)
mustLogFatalf
(
"%v"
,
err
)
}
}
...
@@ -573,6 +573,7 @@ var (
...
@@ -573,6 +573,7 @@ var (
cpu
string
cpu
string
envFile
string
envFile
string
fromJSON
bool
fromJSON
bool
logfile
string
logRollMB
int
logRollMB
int
logRollCompress
bool
logRollCompress
bool
revoke
string
revoke
string
...
...
caddyhttp/httpserver/server.go
View file @
44e3a97a
...
@@ -507,35 +507,16 @@ func (s *Server) Stop() error {
...
@@ -507,35 +507,16 @@ func (s *Server) Stop() error {
// OnStartupComplete lists the sites served by this server
// OnStartupComplete lists the sites served by this server
// and any relevant information, assuming caddy.Quiet == false.
// and any relevant information, assuming caddy.Quiet == false.
func
(
s
*
Server
)
OnStartupComplete
()
{
func
(
s
*
Server
)
OnStartupComplete
()
{
if
!
caddy
.
Quiet
{
if
caddy
.
Quiet
{
firstSite
:=
s
.
sites
[
0
]
return
scheme
:=
"HTTP"
if
firstSite
.
TLS
.
Enabled
{
scheme
=
"HTTPS"
}
fmt
.
Println
(
""
)
fmt
.
Printf
(
"Serving %s on port "
+
firstSite
.
Port
()
+
"
\n
"
,
scheme
)
s
.
OutputSiteInfo
(
"fmt"
)
}
// if caddy process log is going to stdout, printing to log
// here would duplicate to stdout so dont. If -quiet ensure
// that Log is still output even if process log startup isnt. #2469
if
caddy
.
LogDestination
!=
"stdout"
||
caddy
.
Quiet
{
s
.
OutputSiteInfo
(
"log"
)
}
}
}
func
(
s
*
Server
)
OutputSiteInfo
(
LogType
string
)
{
for
_
,
site
:=
range
s
.
sites
{
for
_
,
site
:=
range
s
.
sites
{
output
:=
site
.
Addr
.
String
()
output
:=
site
.
Addr
.
String
()
if
caddy
.
IsLoopback
(
s
.
Address
())
&&
!
caddy
.
IsLoopback
(
site
.
Addr
.
Host
)
{
if
caddy
.
IsLoopback
(
s
.
Address
())
&&
!
caddy
.
IsLoopback
(
site
.
Addr
.
Host
)
{
output
+=
" (only accessible on this machine)"
output
+=
" (only accessible on this machine)"
}
}
if
LogType
==
"fmt"
{
fmt
.
Println
(
output
)
fmt
.
Println
(
output
)
}
else
{
log
.
Println
(
output
)
log
.
Printf
(
"[INFO] Serving %s
\n
"
,
output
)
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment