Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
google-cloud-sdk /
lib /
surface /
logging /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
buckets
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
cmek_settings
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
links
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
locations
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
logs
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
metrics
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
operations
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
recent_queries
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
resource_descriptors
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
saved_queries
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
scopes
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
settings
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
sinks
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
views
[ DIR ]
drwxr-xr-x
2026-06-08 18:08
__init__.py
1.12
KB
-rw-r--r--
1980-01-01 08:00
copy.py
3.11
KB
-rw-r--r--
1980-01-01 08:00
read.py
6.24
KB
-rw-r--r--
1980-01-01 08:00
redact.py
3.21
KB
-rw-r--r--
1980-01-01 08:00
tail.py
7.65
KB
-rw-r--r--
1980-01-01 08:00
write.py
4.88
KB
-rw-r--r--
1980-01-01 08:00
Save
Rename
# -*- coding: utf-8 -*- # # Copyright 2014 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """'logging write' command.""" from apitools.base.py import encoding from googlecloudsdk.api_lib.logging import util from googlecloudsdk.calliope import arg_parsers from googlecloudsdk.calliope import base from googlecloudsdk.core import log @base.UniverseCompatible class Write(base.SilentCommand): """Write a log entry.""" SEVERITY_ENUM = ('DEFAULT', 'DEBUG', 'INFO', 'NOTICE', 'WARNING', 'ERROR', 'CRITICAL', 'ALERT', 'EMERGENCY') PAYLOAD_TYPE = ('text', 'json') @staticmethod def Args(parser): """Register flags for this command.""" parser.add_argument( 'log_name', help=('Name of the log where the log entry will ' 'be written.')) parser.add_argument( 'message', help=('Message to put in the log entry. It can be ' 'JSON if you include `--payload-type=json`.')) parser.add_argument( '--payload-type', choices=Write.PAYLOAD_TYPE, default='text', help=('Type of the log entry payload.')) parser.add_argument( '--severity', required=False, choices=Write.SEVERITY_ENUM, default='DEFAULT', help='Severity level of the log entry.') parser.add_argument( '--monitored-resource-type', default='global', help='Monitored Resource type to add to the payload', ) parser.add_argument( '--monitored-resource-labels', type=arg_parsers.ArgDict(), metavar='KEY=VALUE, ...', default={}, help='Monitored Resource labels to add to the payload', ) util.AddParentArgs(parser, 'log entries to write') def Run(self, args): """This is what gets called when the user runs this command. Args: args: an argparse namespace. All the arguments that were provided to this command invocation. """ messages = util.GetMessages() severity_value = getattr(messages.LogEntry.SeverityValueValuesEnum, args.severity.upper()) monitored_resource = messages.MonitoredResource( type=args.monitored_resource_type ) if args.monitored_resource_labels: monitored_resource.labels = encoding.PyValueToMessage( messages.MonitoredResource.LabelsValue, args.monitored_resource_labels ) entry = messages.LogEntry( logName=util.CreateLogResourceName( util.GetParentFromArgs(args), args.log_name ), resource=monitored_resource, severity=severity_value, ) if args.payload_type == 'json': json_object = util.ConvertToJsonObject(args.message) struct = messages.LogEntry.JsonPayloadValue() # Protobufs in Python do strict type-checking. We have to change the # type from JsonObject.Property to JsonPayloadValue.AdditionalProperty # even though both types have the same fields (key, value). struct.additionalProperties = [ messages.LogEntry.JsonPayloadValue.AdditionalProperty( key=json_property.key, value=json_property.value) for json_property in json_object.properties ] entry.jsonPayload = struct else: entry.textPayload = args.message util.GetClient().entries.Write( messages.WriteLogEntriesRequest(entries=[entry])) log.status.write('Created log entry.\n') Write.detailed_help = { 'DESCRIPTION': """\ {index} If the destination log does not exist, it will be created. By default, all log entries written with this command are written with the "global" resource type. {command} should be used for simple testing purposes. Check Cloud Logging agent for a proper way to send log entries: [](https://cloud.google.com/logging/docs/agent/) """, 'EXAMPLES': """\ To create a log entry in a given log, run: $ {command} LOG_NAME "A simple entry" To create a high severity log entry, run: $ {command} LOG_NAME "Urgent message" --severity=ALERT To create a structured log, run: $ {command} LOG_NAME '{"key": "value"}' --payload-type=json To create a log entry with a custom resource type, run: $ {command} LOG_NAME "A simple entry" --monitored-resource-type=gce_instance --monitored-resource-labels=zone=us-centra1-a,instance_id=1234 """, }