OpenVZ Forum


Home » Mailing lists » Devel » [PATCH, try2, 0/3] Separate logfile and console loglevel
[PATCH, try2, 0/3] Separate logfile and console loglevel [message #8630] Wed, 29 November 2006 17:37 Go to next message
kfh.openvzmail is currently offline  kfh.openvzmail
Messages: 20
Registered: October 2006
Junior Member
Separate logfile and console loglevel
The separation is implemented as follows

1: split --quite and --verbose from LOG_LEVEL
console loglevel is 0 as default

2: Make messages more quiet by default
logger(0,...) -> logger(1, ...)

3: Make logfile more verbose by default
LOG_LEVEL=2

Regards,
Kristian Høgh
Re: [PATCH, try2, 0/3] Separate logfile and console loglevel [message #8657 is a reply to message #8630] Thu, 30 November 2006 13:59 Go to previous messageGo to next message
Mishin Dmitry is currently offline  Mishin Dmitry
Messages: 112
Registered: February 2006
Senior Member
On Wednesday 29 November 2006 20:37, Kristian Høgh wrote:
> Separate logfile and console loglevel
> The separation is implemented as follows
>
> 1: split --quite and --verbose from LOG_LEVEL
> console loglevel is 0 as default
This patch make sense.

>
> 2: Make messages more quiet by default
> logger(0,...) -> logger(1, ...)
>
> 3: Make logfile more verbose by default
> LOG_LEVEL=2
Why do you need them? For me, it is convinient to see at the VE start, which
IP it has. It is better, than additional `vzlist` later.

Igor, please, decide.

>
> Regards,
> Kristian Høgh
>
--
Thanks,
Dmitry.
Re: [PATCH, try2, 0/3] Separate logfile and console loglevel [message #8660 is a reply to message #8657] Thu, 30 November 2006 14:14 Go to previous messageGo to next message
kfh is currently offline  kfh
Messages: 28
Registered: October 2006
Junior Member
On Thursday den 30. November 2006 14:59, Dmitry Mishin wrote:
> On Wednesday 29 November 2006 20:37, Kristian Høgh wrote:
> > Separate logfile and console loglevel
> > The separation is implemented as follows
> >
> > 1: split --quite and --verbose from LOG_LEVEL
> > console loglevel is 0 as default
>
> This patch make sense.
>
> > 2: Make messages more quiet by default
> > logger(0,...) -> logger(1, ...)
> >
> > 3: Make logfile more verbose by default
> > LOG_LEVEL=2
>
> Why do you need them? For me, it is convinient to see at the VE start,
> which IP it has. It is better, than additional `vzlist` later.
>
> Igor, please, decide.

How about skipping info: (at start)
- Setting 2level quota
- Setting CPU limit/units/vcpus
- Configure meminfo

Keeping:
- Adding/Deleting IP address
- Configure/Deleting veth devices

Regards,
Kristian.
Re: Separate logfile and console loglevel [message #8742 is a reply to message #8657] Tue, 05 December 2006 10:36 Go to previous messageGo to next message
kfh is currently offline  kfh
Messages: 28
Registered: October 2006
Junior Member
On Thursday den 30. November 2006 14:59, Dmitry Mishin wrote:
> On Wednesday 29 November 2006 20:37, Kristian Høgh wrote:
> > Separate logfile and console loglevel
> > The separation is implemented as follows
> >
> > 1: split --quite and --verbose from LOG_LEVEL
> > console loglevel is 0 as default
>
> This patch make sense.
I worked on the patch, made --verbose accept argument (--verbose=<int>)
Added new parameter VERBOSE=<int> to /etc/vz/vz.conf. Default is 1 if unset.
--verbose alone increments by 1

> > 2: Make messages more quiet by default
> > logger(0,...) -> logger(1, ...)
> >
> > 3: Make logfile more verbose by default
> > LOG_LEVEL=2
> >
> Why do you need them? For me, it is convinient to see at the VE start,
> which IP it has. It is better, than additional `vzlist` later.
If I use a script to start 10 VEs, it would be nice to see only partial info.
I could do that with --verbose=0. If one fails I can use --verbose=2
What do you think about the output below?

Regards,
Kristian Høgh

Ps.
vzquota, /etc/vz/dists/scripts/none and vps-net_add/vps-net_del are just "exit 0"


# vzctl --verbose=0 start 1010
Starting VE ...
Set hostname: vs1010
VE start in progress...


Default VERBOSE
# vzctl start 1010 / vzctl --verbose=1 start 1010
Starting VE ...
VE is mounted
Unable to create /etc/rc6.d/S00vzreboot: Read-only file system
Adding IP address(es): 10.65.6.214
Running VE script: /etc/vz/dists/scripts/none
Set hostname: vs1010
Running VE script: /etc/vz/dists/scripts/none
Configure veth devices: ve1010.0
VE start in progress...


Default in LOGFILE
# vzctl --verbose start 1010 / vzctl --verbose=2 start 1010
Starting VE ...
Running: /usr/sbin/vzquota show 1010
Running: /usr/sbin/vzquota on 1010 -r 0 -b 1048676 -B 1153534 -i 200100 -I 220100 -e 0 -n 0 -s 0
Mounting root: /var/lib/vz/root/1010 /var/lib/vz/private/root
Running: /etc/vz/conf/vps.mount
VE is mounted
Unable to create /etc/rc6.d/S00vzreboot: Read-only file system
Adding IP address(es): 10.65.6.214
Running: /usr/lib/vzctl/scripts/vps-net_add
Running VE script: /etc/vz/dists/scripts/none
Setting CPU limit: 50
Setting CPU units: 1000
Configure meminfo: 10240
Set hostname: vs1010
Running VE script: /etc/vz/dists/scripts/none
Running: /usr/sbin/vzquota stat 1010 -f
Running: vzquota setlimit 1010 -b 1048576 -B 1153434 -i 200000 -I 220000 -e 0 -n 0
Configure veth devices: ve1010.0
Running: /usr/sbin/vznetcfg init veth ve1010.0
VE start in progress...


# vzctl --verbose=3 start 1010
Starting VE ...
Running: /usr/sbin/vzquota show 1010
Running: /usr/sbin/vzquota on 1010 -r 0 -b 1048676 -B 1153534 -i 200100 -I 220100 -e 0 -n 0 -s 0
Mounting root: /var/lib/vz/root/1010 /var/lib/vz/private/root
Running: /etc/vz/conf/vps.mount
VE is mounted
Set iptables mask 0x000017bf
Set features maks 0000000000000000/0000000000000000
Unable to create /etc/rc6.d/S00vzreboot: Read-only file system
Adding IP address(es): 10.65.6.214
Running: /usr/lib/vzctl/scripts/vps-net_add
Running VE script: /etc/vz/dists/scripts/none
Setting CPU limit: 50
Setting CPU units: 1000
Configure meminfo: 10240
Set hostname: vs1010
Running VE script: /etc/vz/dists/scripts/none
Running: /usr/sbin/vzquota stat 1010 -f
Running: vzquota setlimit 1010 -b 1048576 -B 1153434 -i 200000 -I 220000 -e 0 -n 0
Configure veth devices: ve1010.0
Running: /usr/sbin/vznetcfg init veth ve1010.0
Starting init
VE start in progress...


# vzctl --verbose=0 stop 1010
Stopping VE ...
VE was stopped


# vzctl --verbose=1 stop 1010
Stopping VE ...
VE was stopped
VE is unmounted


# vzctl --verbose=2 stop 1010
Stopping VE ...
VE was stopped
Running: /usr/lib/vzctl/scripts/vps-net_del
Running: /etc/vz/conf/vps.umount
Running: /usr/sbin/vzquota stat 1010 -f
Running: /usr/sbin/vzquota off 1010
VE is unmounted
Running: /usr/lib/vzctl/scripts/vps-stop
Re: Separate logfile and console loglevel [message #8744 is a reply to message #8742] Tue, 05 December 2006 10:47 Go to previous messageGo to next message
Igor Sukhih is currently offline  Igor Sukhih
Messages: 21
Registered: May 2006
Junior Member
Kristian F. Høgh wrote:
> On Thursday den 30. November 2006 14:59, Dmitry Mishin wrote:
>
>> On Wednesday 29 November 2006 20:37, Kristian Høgh wrote:
>>
>>> Separate logfile and console loglevel
>>> The separation is implemented as follows
>>>
>>> 1: split --quite and --verbose from LOG_LEVEL
>>> console loglevel is 0 as default
>>>
>> This patch make sense.
>>
> I worked on the patch, made --verbose accept argument (--verbose=<int>)
> Added new parameter VERBOSE=<int> to /etc/vz/vz.conf. Default is 1 if unset.
> --verbose alone increments by 1
>
>
>>> 2: Make messages more quiet by default
>>> logger(0,...) -> logger(1, ...)
>>>
>>> 3: Make logfile more verbose by default
>>> LOG_LEVEL=2
>>>
>>>
>> Why do you need them? For me, it is convinient to see at the VE start,
>> which IP it has. It is better, than additional `vzlist` later.
>>
> If I use a script to start 10 VEs, it would be nice to see only partial info.
> I could do that with --verbose=0. If one fails I can use --verbose=2
> What do you think about the output below?
>
I'm Ok with it the only problem the --verbose option already released
and this is can break already worked scripts.

> Regards,
> Kristian Høgh
>
> Ps.
> vzquota, /etc/vz/dists/scripts/none and vps-net_add/vps-net_del are just "exit 0"
>
They do exit with error in place error happened.

--
Igor.
Re: Separate logfile and console loglevel [message #8747 is a reply to message #8744] Tue, 05 December 2006 11:07 Go to previous messageGo to next message
kfh is currently offline  kfh
Messages: 28
Registered: October 2006
Junior Member
On Tuesday den 5. December 2006 11:47, Igor Sukhih wrote:
> Kristian F. Høgh wrote:
> > On Thursday den 30. November 2006 14:59, Dmitry Mishin wrote:
> >> On Wednesday 29 November 2006 20:37, Kristian Høgh wrote:
> >>> Separate logfile and console loglevel
> >>> The separation is implemented as follows
> >>>
> >>> 1: split --quite and --verbose from LOG_LEVEL
> >>> console loglevel is 0 as default
> >>
> >> This patch make sense.
> >
> > I worked on the patch, made --verbose accept argument (--verbose=<int>)
> > Added new parameter VERBOSE=<int> to /etc/vz/vz.conf. Default is 1 if
> > unset. --verbose alone increments by 1
> >
> >>> 2: Make messages more quiet by default
> >>> logger(0,...) -> logger(1, ...)
> >>>
> >>> 3: Make logfile more verbose by default
> >>> LOG_LEVEL=2
> >>
> >> Why do you need them? For me, it is convinient to see at the VE start,
> >> which IP it has. It is better, than additional `vzlist` later.
> >
> > If I use a script to start 10 VEs, it would be nice to see only partial
> > info. I could do that with --verbose=0. If one fails I can use
> > --verbose=2 What do you think about the output below?
>
> I'm Ok with it the only problem the --verbose option already released
> and this is can break already worked scripts.

--verbose still works. It increments current verbose by 1.
If I run:
vzctl --verbose=0 --verbose --verbose start 1010
verbose will be 2 (0 + 1 + 1)

> > Regards,
> > Kristian Høgh
> >
> > Ps.
> > vzquota, /etc/vz/dists/scripts/none and vps-net_add/vps-net_del are just
> > "exit 0"
>
> They do exit with error in place error happened.
I was unclear. My scripts only contains "exit 0".
I don't know if the standard scripts make any output by default.

> --
> Igor.
/Kristian.
Re: Separate logfile and console loglevel [message #8749 is a reply to message #8747] Tue, 05 December 2006 11:40 Go to previous messageGo to next message
Igor Sukhih is currently offline  Igor Sukhih
Messages: 21
Registered: May 2006
Junior Member
Kristian F. Høgh wrote:
> On Tuesday den 5. December 2006 11:47, Igor Sukhih wrote:
>
>> Kristian F. Høgh wrote:
>>
>>> On Thursday den 30. November 2006 14:59, Dmitry Mishin wrote:
>>>
>>>> On Wednesday 29 November 2006 20:37, Kristian Høgh wrote:
>>>>
>>>>> Separate logfile and console loglevel
>>>>> The separation is implemented as follows
>>>>>
>>>>> 1: split --quite and --verbose from LOG_LEVEL
>>>>> console loglevel is 0 as default
>>>>>
>>>> This patch make sense.
>>>>
>>> I worked on the patch, made --verbose accept argument (--verbose=<int>)
>>> Added new parameter VERBOSE=<int> to /etc/vz/vz.conf. Default is 1 if
>>> unset. --verbose alone increments by 1
>>>
>>>
>>>>> 2: Make messages more quiet by default
>>>>> logger(0,...) -> logger(1, ...)
>>>>>
>>>>> 3: Make logfile more verbose by default
>>>>> LOG_LEVEL=2
>>>>>
>>>> Why do you need them? For me, it is convinient to see at the VE start,
>>>> which IP it has. It is better, than additional `vzlist` later.
>>>>
>>> If I use a script to start 10 VEs, it would be nice to see only partial
>>> info. I could do that with --verbose=0. If one fails I can use
>>> --verbose=2 What do you think about the output below?
>>>
>> I'm Ok with it the only problem the --verbose option already released
>> and this is can break already worked scripts.
>>
>
> --verbose still works. It increments current verbose by 1.
> If I run:
> vzctl --verbose=0 --verbose --verbose start 1010
> verbose will be 2 (0 + 1 + 1)
>
If I correctly understand you will process --verbose and --verbose=0
the same way?
So 'vzctl --verbose ' will work as well?
>
>>> Regards,
>>> Kristian Høgh
>>>
>>> Ps.
>>> vzquota, /etc/vz/dists/scripts/none and vps-net_add/vps-net_del are just
>>> "exit 0"
>>>
>> They do exit with error in place error happened.
>>
> I was unclear. My scripts only contains "exit 0".
> I don't know if the standard scripts make any output by default.
>

There only error output by default, look at error() function.

# Prints error message and exits
# Parameters:
# $1 - error message
# $2 - exit code
# Example of usage:
# error "Fatal error" 1
function error()


--
Igor.
Re: Separate logfile and console loglevel [message #8751 is a reply to message #8749] Tue, 05 December 2006 12:07 Go to previous message
kfh is currently offline  kfh
Messages: 28
Registered: October 2006
Junior Member
On Tuesday den 5. December 2006 12:40, Igor Sukhih wrote:
> Kristian F. Høgh wrote:
> > On Tuesday den 5. December 2006 11:47, Igor Sukhih wrote:
> >> Kristian F. Høgh wrote:
> >>> On Thursday den 30. November 2006 14:59, Dmitry Mishin wrote:
> >>>> On Wednesday 29 November 2006 20:37, Kristian Høgh wrote:
> >>>>> Separate logfile and console loglevel
> >>>>> The separation is implemented as follows
> >>>>>
> >>>>> 1: split --quite and --verbose from LOG_LEVEL
> >>>>> console loglevel is 0 as default
> >>>>
> >>>> This patch make sense.
> >>>
> >>> I worked on the patch, made --verbose accept argument (--verbose=<int>)
> >>> Added new parameter VERBOSE=<int> to /etc/vz/vz.conf. Default is 1 if
> >>> unset. --verbose alone increments by 1
> >>>
> >>>>> 2: Make messages more quiet by default
> >>>>> logger(0,...) -> logger(1, ...)
> >>>>>
> >>>>> 3: Make logfile more verbose by default
> >>>>> LOG_LEVEL=2
> >>>>
> >>>> Why do you need them? For me, it is convinient to see at the VE start,
> >>>> which IP it has. It is better, than additional `vzlist` later.
> >>>
> >>> If I use a script to start 10 VEs, it would be nice to see only partial
> >>> info. I could do that with --verbose=0. If one fails I can use
> >>> --verbose=2 What do you think about the output below?
> >>
> >> I'm Ok with it the only problem the --verbose option already released
> >> and this is can break already worked scripts.
> >
> > --verbose still works. It increments current verbose by 1.
> > If I run:
> > vzctl --verbose=0 --verbose --verbose start 1010
> > verbose will be 2 (0 + 1 + 1)
>
> If I correctly understand you will process --verbose and --verbose=0
> the same way?
> So 'vzctl --verbose ' will work as well?
Yes it will.

If /etc/vz/vz.conf contains VERBOSE=1 (or no VERBOSE at all)
vzctl --verbose ..., will result in verbose level 2

If /etc/vz/vz.conf contains VERBOSE=0, the command:
vzctl --verbose ..., will result in verbose level 1

If /etc/vz/vz.conf contains VERBOSE=2, the command:
vzctl --verbose=0 --verbose ..., will result in verbose level 1,
as VERBOSE is ignored if commandline contains --verbose="number"

<Stupid example>
/etc/vz/vz.conf contains VERBOSE=99
vzctl --verbose --verbose=1 --verbose --verbose ...

verbose=99, +1, verbose=1, +1, +1. The resulting verbose will be 3:
</Stupid example>

/Kristian.
Previous Topic: Re: [Patch 1/3] Miscellaneous container fixes
Next Topic: [PATCH, try3, 1/3] Separate logfile and console loglevel
Goto Forum:
  


Current Time: Sun Jul 14 23:35:18 GMT 2024

Total time taken to generate the page: 0.02309 seconds