Inter-operable log4php and Chainsaw/remote log viewer - log4php

I'm in need of a remote log viewer like chainsaw for log4php. When i use log4j, chainsaw is my first option, where as though log4php is same to log4j, chainsaw is not responding well.
For, eg., i gave this config
log4php.appender.A3=LoggerAppenderSocket
log4php.appender.A3.remoteHost=cin10050
log4php.appender.A3.port=4445
log4php.appender.A3.layout=LoggerLayoutXml
Chainsaw generates a log message in chainsaw-logs :
Connection lost! :: invalid stream header: 3C6C6F67
Does any one have a solution?
Thanks

Chainsaw provides an XMLSocketReceiver, which could be used to receive events from log4php, but I don't think they send events in a format that the receiver can process.
I'd suggest logging to a regular text log file and using the latest developer snapshot of Chainsaw, available here: http://people.apache.org/~sdeboy
Use the 'File,Load Chainsaw configuration' option and select 'process a log file'. Then hit the 'open file' to browse to your log file location, and then specify your 'log file format'. A simple one that will always work is:
MESSAGE
That format will just make the entire log line the 'message' field. If you'd like Chainsaw to parse your levels and timestamps etc, that's possible, you just need to use the keywords and match up your format.
Then, click the 'always start Chainsaw with this configuration' check box, and then hit the 'save configuration as' button and save your chainsaw configuration to something like log4php-chainsaw-config.xml.
When you hit ok, you should get a new tab with your log file contents.
Scott

Related

How do I open a file with a specific application rather than its default application?

I am trying to open files using a specified executable; just like as if you were to right mouse click on a file then scroll to "Open with"
I tried what kaymaf said and reviewed the docs, but I cannot seem to get this to work.
Dim FI As New FileInfo(GetFileNameFromListViewItem(ListViewCollection.SelectedItems(0)))
Dim GetExif As Process = System.Diagnostics.Process.Start("C:\Users\*username*\Downloads\exiftool.exe", FI.FullName)
This just ends up open the executable and rather than opening the file with the executable.
You would like to open a file with your program using the Windows context menu; and do you want to get an entry in that menu? If that is not correct, the answer can be deleted.
I found this in a German forum, and they refer to this site:
This is the translated text:
One possibility would be that you register your file extension and your program in the system to open this file extension. As soon as the system knows everything, you only need to right-click on the file(s) and in the context menu, in addition to the standard entries, another menu item for opening these files is displayed. If you select this menu item, your program will start automatically if it has not yet started, and you can read out / determine the path to this file or several files in your program and process it accordingly. How it all works is described here: ookii.org/Blog/opening_files_via_idroptarget_in_net
On this page there is also a sample for download (start text files with your own program via an additional entry in the context menu / display paths to the files). It is not a VB, but it should be translatable without any problems. Corresponding information on the page and the comments should be observed.

PHPStorm: Disable Auto Opening of File transfer tool window

I'm using PHPStorm 10, every first save after the opening PHPStorm the File transfer tool windows show up, telling me that the file is being auto uploaded.
I've tried all type of settings, without good results: the file transfer window keep showing up at the first save. How can i disable this behavior?
This is the tool window:
File Transfer tool window
Open Tools > Deployment > Options and change Operations logging to "Errors only".
There is no such option in Settings/Preferences.
Just close the window (minimize it) and it will not show up again for this session (only notifications, which you can disable if so desired via Settings/Preferences | Appearance & Behavior | Notifications -- look for "Web deployment" entries).
If you change the View Mode to Undock and drag the inner edge of the File Transfer window outside the viewport, it will effectively be disabled. This is not very elegant and I hope JetBrains gives us a setting to disable this soon.
To see the File Transfer window again, right-click on File Transfer and select another view option such as Dock Pinned.
As of PHPStorm 2019.1.2. Thanks to Erenor's comment for the inspiration.
Edit: Ástþór's answer does work provided none of the transfers are throwing errors. Due to the way a server is set up on one of my projects, it always gives a benign error, which makes the File Transfer window pop up.

Intellij Idea does not recognize ivy.xsd

Why my IDE does not recognize xsd by URI ?
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
You will need to download the schema first. IntelliJ allows to do that using intentions. Set cursor on the red marked fragment, press Alt+Enter and select 'Fetch External Resource'. Schema should be downloaded and you will start getting element suggestions in the file.
Sometimes automatic resource fetching may not work and the location will remain red marked. In such case you will need to download the schema to some location to disk and select 'Manually Setup External Resource' from intentions menu. Point to the downloaded file and you should get it working.

Is there a way to find output of previous runs in IntelliJ?

Every time I run some program, the output of previous run of some other program seems to be overwritten by the new output. Is there a way to see the output of previously run programs?
There is not. In the Run/Debug configuration, on the log tab, you can turn on the option "Save console output to file". (You can set this under the "Defaults" configuration so that it always there by default. That however only applies to the current project. To set as a default for all future projects as well, from the Welcome screen (i.e. close all projects) go to Configure > Project Defaults > Run Configurations) Unfortunately, that output file is (also) overwritten on each new run. To the best of my knowledge, there is no way to add a timestamp to the file name. You can open a feature request asking they enhance this to retain the last x number of runs or allow a timestamp.
In the meantime, there are two options you can use for a workaround.
Option 1 - Logging Framework
The first option is to use a logging framework. This won't include the start up information or any System.out/err that the console has (unless you use something like sysout-over-slf4j). On the same "Logs" tab in the Run/Debug configuration, you can set to have the log file shown in the console tool window. The nice thing is that IntelliJ IDEA only shows new output for that run. But the output from previous runs is still in the log file (assuming your logger is set up to append and not overwrite on new runs). When specifying the log name, you can use wild characters (to deal with things like a date stamp in the log). It use Ant fileset pattern notation. Click the help button on "Edit Log Files Aliases" dialog for more information. By default, IDEA only shows the latest log, unless you select the "Show all files coverable by pattern" on the "Edit Log Files Aliases".
Option 2 - Use a Script
Another option would be to use the "Save console file output to file" option. Then write an external script or Ant task that moves/renamed that output. (You could make it fancy so it only saves the last x runs, rolling the previous ones names.) Then in the run/debug configuration, use either the "Run External tool" or "Run Ant Target" option in the "Before Launch" section to run your script. (Again, you can set this on the default configurations so it is there automatically.) This way your script will run, renaming the file, before the new output is created and overwrites the old.
In addition to the options mentioned by Javaru, it is possible to tell IntelliJ to save all console outputs til a local file:
Edit Run Configuration -> Logs -> Save console output to file

how to implement openwith in winrt xaml

i am working on pdf viewer kind app in winrt.
it is almost done .but i want to add a feature that
when user RIGHT click on any pdf File in win32 there should be an option to open with my reader. can any one please tell me how to achive this
You need to enable your application to handle the pdf file type. You can do this by double-clicking on the application manifest file in Visual Studio. In the Declarations tab, add a new File Type Association. Then fill in the fields for the file association.
For example, the following adds an association for the ".myfile" extension:
The other thing that needs to be done is that you must in code handle the OnFileActivated event handler. This will be called whenever the end user opens a file with the associated extension from Explorer.
Note that for the file association to work, your application must be run at least once.
See the following link for more info on associating a file type: How to handle file activation